Displaying 20 results from an estimated 10000 matches similar to: "Using migrations with legacy schema"
2006 Aug 15
1
Can migrations be used for these cases?
Hi
A newb question.
Can I use migrations if all of the following requirements are imposed at
the same time.
1. Copy data from an old schema to a new schema, the difference in the 2
schemas is about 25%, 3 new tables and 4 new columns.
2. Copy data from Oracle schema to DB2 schema, around 25% difference in
2 schemas as above.
3. Neither old nor the new schema tables have an
2006 Feb 25
1
Migrations for initial schema: Where to put initial data?
Hi, I''m trying to get my head around using migrations to define my
initial schema.
When using migrations, I want to:
- Avoid creating a new migration for every small change. Limit it to one
migration per checkin.
- When creating a new (fresh) schema, I do not want to go through the
overhead of all the migrations.
These are the steps I came up with, to create the initial schema:
1.
2007 Feb 03
1
Postgres + tsearch2, migrations, and unit testing
I''m sure people have encountered this before, but I''ve been
unsuccessful at finding anything about it.
Basically, I got a rails app that uses postgres and tsearch2 for some
full text indexing and I''d like to be performing unit tests. Now,
there''s the whole deal of how to get the test database to load all the
tsearch2 information properly.
I tried to come up
2005 Dec 14
3
Plugin w/ Migrations and/or Fixtures?
I''m working on a plugin which needs to add both schema and data to the app
database, and I''m trying to figure out the best way to do it. I''d like to use a
db migration to modify the schema and load the data from a YAML fixture, but
Rails doesn''t seem to support migrations for plugins. To do so, the schema_info
table would need to change to include a
2006 Jun 19
1
AWDwR2: Loading data in migrations
The new chapter in Agile Web Development with Rails talks about using
migrations to load data from fixtures. This is a great idea, I''ve wanted to
do this. This allows you a good way to create sample data that you can use
during development, testing or demoing of an application. My question is
how do you keep it separated from the real data? For example, say you have
a User and Account
2006 Aug 17
3
Migrations for migrating data across databases - is it possible?
Hi All
I am trying to understand if I can use migrations to migrate data under the
following conditions
1. Across 2 different databases (Oracle/DB2) with same schemas.
2. Across 2 different databases (Oracle/DB2) with different schemas.
I am trying to avoid writing DBI/OCI8 scripts.
Can somone please shed some light if this is even possible?
thanks
-daya
-------------- next part
2011 Jun 09
1
Rails 3.1 RC4 has broken migrations
Rails 3.1 RC4 has broken migrations
$ jruby -v
jruby 1.6.2 (ruby-1.8.7-p330) (2011-05-23 e2ea975) (Java HotSpot(TM)
64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
$ jruby -S rails -v
Rails 3.1.0.rc4
$ jruby -S rails new myapp -d jdbcpostgresql
[...]
$jruby -S rake db:create
[...]
$ jruby -S rails g model user name:string
invoke active_record
create
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone,
For one of our projects we have a need to deploy and maintain a demo.
As a result I''ve attempted to setup a set of rake tasks for the job.
My goal is have one rake task called "deploy_demo" which purges the
database, migrates to the current schema, and loads the db from a set
of fixture files in a specified location.
I''ve written two new tasks the perform
2006 Apr 24
4
[TIP] Ensure your test data is valid
Recently I wanted to check that my test data was valid. Seems like a
reasonable thing to want to do so I thought I''d share the rake task. Add
this code to a rake file in lib/tasks and run with rake
db:fixtures:validate. It will print out the class, record id and error
messages for any model objects that fail validation.
Enjoy!
-Jonathan.
--
namespace :db do
namespace :fixtures do
2006 Aug 16
0
problems using Migrations
Hi All
I am trying to figure out if I can use migratons when the following
requirements are imposed at the same time.
1. Migrating data from an old schema to a new schema, the difference in the
2
schemas is about 25%, 3 new tables and 4 new columns.
2. Migrating data from Oracle schema to DB2 schema, around 25% difference in
2 schemas as above.
3. Neither old nor the new schema tables have a
2006 Aug 16
2
accessing a model from a migration
Hello again!
ok, i have some initial migration code which sets up my apps schema. i have a
few tables that get initialized with data in this migration where i have the
table data in yaml format in test/fixtures. i use db:fixtures:load
FIXTURES=countries,provstates,employees to initialize these tables..
here''s the wrinkle: employees when it gets loaded should only contain the admin
2006 Feb 28
0
ActiveRecord: Legacy primary keys
Hi,
I''m building a frontend for a legacy schema, with tables like this:
CREATE TABLE `types` (
`a_type_cd` varchar(6) NOT NULL default '''',
`a_type` varchar(30) NOT NULL default '''',
PRIMARY KEY (`a_type_cd`)
);
The primary key is specified by the user (not auto-generated), and needs
to be updateable. I create the following a base class to
2005 Oct 05
0
has_and_belongs_to_many on legacy DB
I am working with mapping ActiveRecord onto a legacy database. All is going
well (using set_table_name, set_primary_key, etc), but I can''t get my
many<=>many relationships to work.
My contrived example of the situation:
Student has_and_belongs_to_many Teachers. This is mapped via table
student2teacher where the foreign keys are studentId and teacherId. The
primary key in Student
2006 Jan 18
3
legacy database on remote host
I''m getting this error in webrick then it crashes leaving nothing in the
log.
ruby: symbol lookup error:
/usr/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so: undefined symbol:
mysql_sqlstate
Here is the standard query I would normally write to get the data.
select * from child,parent
where CONCAT(SUBSTRING(child.item_number,1,14,''00'') =
parent.order_number and
2006 Jul 03
9
Migrations from Mysql to Oracle. PLS HELP!
Hi all,
I''m using Rails/Mysql as development platform. the production server is
under Rails/Oracle.
Right now, i''m trying to install my application under the production
server, the connection to orcale is fine via Rails, but i have a weird
problem. example :
here is a extract from my db scheme :
Table User :_____________
id_user |
first_name |
2006 Jan 16
3
the dreaded "Before updating scaffolding from new DB schema, try creating a table for your model (Blog)" error
Hi
Can any one help me with this? I think that this is soemthing quite
simple as there is quite abit traffic about this on the web and everyone
sems to figure it out. I have tried most of the solutions that I can
find. but nothing.
I have mysql 5.0.11 working on linux redhat 9. ruby is working rails
install mysql library seem to be there.
to some trying rt get mysql to install need to
2006 Jul 25
2
join in legacy DB?
I''ve got a problem with some tables that don''t follow any RAILS
standards. how do I define the join in the model when all three tables
have wacky names?
class Machine < ActiveRecord::Base
set_table_name "tbl_CodeMgmt_Host"
set_primary_key "Id"
end
class Pool < ActiveRecord::Base
set_table_name "tbl_CodeMgmt_Pool"
set_primary_key
2006 Feb 05
2
Continuous Integration question (not CIA question)
On 2/5/06, Joe Van Dyk <joevandyk@gmail.com> wrote:
> On 2/4/06, Jonathan Weiss <jw@innerewut.de> wrote:
> > Joe Van Dyk wrote:
> > > Hi,
> > >
> > > I''d like to set up CIA. So I added the plugin to my app, went to my
> > > subversion server, added the post commit, added a build directory.
> > >
> > > I checked
2006 Jan 25
1
Migrations for populating authority tables
I''ve got a number of fixtures which populate ''authority'' tables in an
app (eg tables which are used to construct the values of selects or
valid ''constants''). These will be updated infrequently and are
''configuration'' data, so I''m not sure its worth constructing an
interface to do this in the deployed app.
Seeing as
2006 Apr 21
1
Using fixtures inside migrations
Hi,
I want to add data from a fixture file to a table inside a migration.
I''ve saved the file in db/migrate/fixtures/countries.yml
I guess I could just open the file, read the entries, and add them to
the database using AR, but I''m hoping I can use Rails for all that.
Also, if I have a file, say, with 200,000+ records, what would be the
best method (performance-wise) to go