Displaying 20 results from an estimated 300000 matches similar to: "Migrations, development, test, etc."
2006 Apr 26
2
migrations and database creation
Is there a way to pass the database name in config/database.yml to a
migration task such that the appropriate (test, development or
production) DB is created by the initial migration?
What I would like to do is to get this sort of thing to work:
class RbacDataStructures < ActiveRecord::Migration
def self.up
create_database <<dbname from database.yml>>
class
2005 Dec 27
4
Migrations & Unit Testing: Possible Bug in Rails?
I recently started using migrations to create the schema of a Rails
project I am working on. The database I am using for this project is
MySQL. The initial migration creates the table and also includes a
number of execute statements (to do some things like setting primary
keys, autoincrement on some columns and other messy voodoo).
Running "rake migrate" creates the database with no
2006 Jul 15
2
Migrations question
I started working on an app. It''s new at this point so backing up
wouldn''t be difficult, however I''m wondering if there is some plugin
that exists where I can use it to grab the current database (set up
without migrations) and create a migration file ?
Sort of grab a current snapshot of the database and use that as a
stating point for my migrations directory.
TIA
Stuart
2006 Jun 26
4
Migrations and svn branches...
We are currently doing some development on a variety of branches that
each have their own set of migrations (gee, database changes on a
branch? how novel). The problem is with this strictly linear numbering
of the migrations and these alternate branches.
Let''s suppose I have branches/foo that adds two migrations
024_add_foo.rb and 025_refine_foo.rb
and then another branches/bar
2006 Mar 09
4
Testing Migrations
Is there some standard way to test migrations?
It seems to me that an additional safeguard for migrations would be to
test and see if applying the migrations to the test database allows one
to reconstruct the structure of the development database.
If you can''t, then there is an error in your migrations, most likely
because someone hand-modified the database without generating a
2006 Apr 03
2
HABTM migrations
Bad rails day for Matt-
In a migration, for a habtm:
create_table :teams_users do |t|
t.column :team_id, :integer
t.column :user_id, :integer
end
Ok, fine. In a controller (well really a migration script):
@user.teams << Team.find( 3 )
And the SQL pumped at my server is:
INSERT INTO teams_users (`team_id`, `id`, `user_id`) VALUES (3, 3, 34)
Which
2008 May 18
0
Spec a before_destroy callback in Sequel
Hi
I''m struggling to find a neat way to spec this. The Sequel ORM
doesn''t support automatically destroying dependent models. It''s easy
enough to do in a callback though:
class Changeset < Sequel::Model
has_many :migrations, :class => DataModel::Migration
before_destroy do
migrations.each { |m| m.destroy }
end
# ...
end
2006 Jun 03
2
migrations unit test and sqlite3 add_column
Hi all,
I submitted a patch the other day for an issue I ran into running an
"add_column" migration on a sqlite3 database when there is existing
data in the table, and the new column has ":null=>false".
Details at http://dev.rubyonrails.org/ticket/5215.
The issue I encountered was not picked due to the unit test not
having any actual data in it before running the
2007 Dec 16
1
Unit test preperation with migrations
I have spent sometime this afternoon learning how to unit test rails
applications and integrate the Cerberus CI tool. One key area confuses
me however, and I would appreciate other peoples views of how best to
overcome the issue.
My understanding is that the ''test'' and ''test:units'' have the
db:test:prepare pre-requisite which copies the schema from dev to the
2006 Aug 03
0
Segmenting migrations based on target environment
I am developing against an existing database schema that I am enhancing
with some custom tables.
In the development and test database, I have basically generated
"copies" of the legacy tables that already exist in production. So I
have 12 migration files, some of which create dev/test versions of
production tables and some of which create tables that will need to be
moved to
2006 Apr 25
3
command rake migration also runs #down method ?
Hi,
i am new to rails and trying to understand the migrate feature of rake
whenever I call "rake migrate", i understand it call all the latest
version of a given of given migrate files.
Now when these files are executed, id the #down method called and then
the #up ? or must i explicitly call the #down method from rake. If yes
how do i do that from rake ?
I experimented with rake
2007 Dec 09
2
rake db:redo & rake migrations:reset - or how to cope with the change of db:reset
As many of you know, rake db:reset changed behavior just before Rails
2.0 got released.
db:reset used to drop the database, re create it and migrate it up.
The core team after integrating this feature, realized that it was not
used as intended and instead db:create now uses the schema.rb file
instead of the migrations.
Check the many discussions we had about this topic, you will quickly
notice
2013 Jun 11
1
Setting up paths etc. for Qt 4 development
Hi,
I was just wondering, is there a "correct" or "preferred" way of setting
up the path and other environment variables for Qt 4 development/build
using qmake and all - on a CentOS 6 system?
I mean, this does not work out-of-the box, at least if you have build
files that assume "qmake" may be executed just like that - as there is
no Qt 4 qmake on the path,
2010 Mar 07
6
some love for migrations
I have a semi-grand plan for some changes to migrations. Mostly this
is motivated by the upcoming 3.0 release and wanting to get migrations
in engines working.
1. Don''t skip migrations with version numbers lower than "current".
I only recently tripped over this, but apparently it''s been this way
since 2.1 when we got timestamps masquerading as large/sparse
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.
2006 Apr 17
1
migration issue
of course, now that I am relying upon migrations, I''m at a loss to
explain why it isn''t working.
I have a system which has production and development and I have a
development system at home where I created all the new code and
migrations.
I committed my changes via svn and used ''svn update'' to update the live
system.
I started by running the migration on the
2006 Jul 31
1
Migrations that set default values
To reverse a migration that sets a default value, do you set the default to nil?
And, if you''re setting a couple of default values just to make early
development easier, is it best to do that directly to the database and
not clutter your migrations with them? (I.e., it''s not a *real* db
change.)
Thanks,
--
Austin Govella
Thinking & Making: IA, UX, and IxD
2006 Jun 29
9
Handling multiple developers making migrations and using svn
Hey all,
I''ve run into an interesting scenario that I think some of you might have
some suggestions on. I am currently working on a RoR project and we are
making full use of the migrations. We are also using a subversion repository
for our source control. Now, the problem....
We are both making migrations and checking them into SVN. So, if in our
checkout we have migrations up to 10 and
2006 Apr 01
1
UTF-8 in migrations: problem with broken chars in db
I need to put some data into the database using migrations. The data
needs to be in UTF-8 format (since the database and the rest of the
Rails application is UTF-8). It doesn''t work.
I have set up the UTF-8 support in environment.rb (which works perfectly
in the rest of the application). I have also tested to save the
migration file as a UTF-8 file (variable char length), as a
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