Is anyone using migrations with a SQL Server database who might be able to
lend me a hand? I''ve used migrations with MySql in the past and
haven''t
run into any issues so forgive When I run rake migrate nothing is actually
getting updated in my database. I created a migration using
./script/generate migration AddFooTable and updated the migration to look as
follows:
class AddFooTable < ActiveRecord::Migration
def self.up
create_table "Foo" do |t|
t.column "Name", :string, :limit => 50
end
end
def self.down
drop_table "Foo"
end
end
When I run rake migrate the database doesn''t get updated. My new table
doesn''t show up and my schema_info version doesn''t get
updated. I have a
couple questions:
1) Why would the schema_info table be created multiple times (at least
attempted?).
2) Why isn''t an error be shown after I run rake migrate if the
migration is
failing? Where can I look for more details?
3) Does anyone have any ideas as to what might be going wrong?
FYI, I have the following in my environment.rb file: ActiveRecord::
Base.connection.instance_variable_get("@connection")["AutoCommit"]
= false
The trace when I run rake migrate --trace is as follows:
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
** Invoke db_schema_dump (first_time)
** Invoke environment
** Execute db_schema_dump
The following SQL is executed:
Audit Login -- network protocol: TCP/IP
set quoted_identifier on
set implicit_transactions off
set cursor_close_on_commit off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set language us_english
set dateformat mdy
set datefirst 7
54
SQL:BatchCompleted set implicit_transactions on 54
SQL:BatchCompleted SELECT 1 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as
DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''schema_info'',
COLUMN_NAME)
as Length, COLUMNPROPERTY(OBJECT_ID(''schema_info''),
COLUMN_NAME,
''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''schema_info''
54
SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54
SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54
SQL:BatchCompleted CREATE TABLE Foo ([id] int NOT NULL IDENTITY(1, 1)
PRIMARY KEY, [Name] varchar(50)) 54
SQL:BatchCompleted UPDATE schema_info SET version = 2 54
SQL:BatchCompleted SELECT @@ROWCOUNT AS AffectedRows 54
SQL:BatchCompleted SELECT TOP 1 * FROM schema_info 54
SQL:BatchCompleted SELECT table_name from information_schema.tables WHERE
table_type = ''BASE TABLE'' 54
SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as
DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''Foo'',
COLUMN_NAME) as
Length, COLUMNPROPERTY(OBJECT_ID(''Foo''), COLUMN_NAME,
''IsIdentity'') as
IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME = ''Foo'' 54
SQL:BatchCompleted EXEC sp_helpindex Foo 54
SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN 54
And finally the log file contains the following:
# Logfile created on Wed Jan 18 23:10:19 Eastern Standard Time 2006 by
logger.rb/1.5.2.4
[4;36;1mSQL (0.000000) [0;1mDBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
There is already an object named ''schema_info'' in the
database.
HRESULT error code:0x80020009
Exception occurred.: CREATE TABLE schema_info (version int)
[4;35;1mSQL (0.000000) DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
There is already an object named ''schema_info'' in the
database.
HRESULT error code:0x80020009
Exception occurred.: CREATE TABLE schema_info (version int)
[4;36;1mSQL (0.000000) [0;1mSELECT COLUMN_NAME as ColName,
COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType,
COL_LENGTH(''schema_info'', COLUMN_NAME) as Length,
COLUMNPROPERTY(OBJECT_ID(''schema_info''), COLUMN_NAME,
''IsIdentity'') as
IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME = ''schema_info''
[4;35;1mSQL (0.000000) SELECT TOP 1 version FROM
schema_info
[4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 version FROM
schema_info
Migrating to AddFooTable (2)
[4;35;1mSQL (0.000000) CREATE TABLE Foo ([id] int NOT NULL
IDENTITY(1, 1) PRIMARY KEY, [Name] varchar(50))
[4;36;1mSQL (0.000000) [0;1mSELECT @@ROWCOUNT AS AffectedRows
[4;35;1mSQL (0.000000) UPDATE schema_info SET version = 2
[4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 * FROM schema_info
[4;35;1mSQL (0.000000) SELECT table_name from
information_schema.tables WHERE table_type = ''BASE TABLE''
[4;36;1mSQL (0.020000) [0;1mSELECT COLUMN_NAME as ColName,
COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType,
COL_LENGTH(''Foo'',
COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID(''Foo''),
COLUMN_NAME,
''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''Foo''
[4;35;1mSQL (0.000000) EXEC sp_helpindex Foo
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/a7267aa4/attachment-0001.html
Note: Tried sending this to the list without success. Forgive me if it
comes through more then once.
Is anyone using migrations with a SQL Server database who might be able to
lend me a hand? I''ve used migrations with MySql in the past and
haven''t
run into any issues so forgive When I run rake migrate nothing is actually
getting updated in my database. I created a migration using
./script/generate migration AddFooTable and updated the migration to look as
follows:
class AddFooTable < ActiveRecord::Migration
def self.up
create_table "Foo" do |t|
t.column "Name", :string, :limit => 50
end
end
def self.down
drop_table "Foo"
end
end
When I run rake migrate the database doesn''t get updated. My new table
doesn''t show up and my schema_info version doesn''t get
updated. I have a
couple questions:
1) Why would the schema_info table be created multiple times (at least
attempted?).
2) Why isn''t an error be shown after I run rake migrate if the
migration is
failing? Where can I look for more details?
3) Does anyone have any ideas as to what might be going wrong?
FYI, I have the following in my environment.rb file: ActiveRecord::
Base.connection.instance_variable_get("@connection")["AutoCommit"]
= false
The trace when I run rake migrate --trace is as follows:
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
** Invoke db_schema_dump (first_time)
** Invoke environment
** Execute db_schema_dump
The following SQL is executed:
Audit Login -- network protocol: TCP/IP
set quoted_identifier on
set implicit_transactions off
set cursor_close_on_commit off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set language us_english
set dateformat mdy
set datefirst 7
54
SQL:BatchCompleted set implicit_transactions on 54
SQL:BatchCompleted SELECT 1 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted CREATE TABLE schema_info (version int) 54
SQL:BatchCompleted select * from CREATE TABLE schema_info (version
int) 54
SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as
DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''schema_info'',
COLUMN_NAME)
as Length, COLUMNPROPERTY(OBJECT_ID(''schema_info''),
COLUMN_NAME,
''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''schema_info''
54
SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54
SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54
SQL:BatchCompleted CREATE TABLE Foo ([id] int NOT NULL IDENTITY(1, 1)
PRIMARY KEY, [Name] varchar(50)) 54
SQL:BatchCompleted UPDATE schema_info SET version = 2 54
SQL:BatchCompleted SELECT @@ROWCOUNT AS AffectedRows 54
SQL:BatchCompleted SELECT TOP 1 * FROM schema_info 54
SQL:BatchCompleted SELECT table_name from information_schema.tables WHERE
table_type = ''BASE TABLE'' 54
SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as
DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''Foo'',
COLUMN_NAME) as
Length, COLUMNPROPERTY(OBJECT_ID(''Foo''), COLUMN_NAME,
''IsIdentity'') as
IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME = ''Foo'' 54
SQL:BatchCompleted EXEC sp_helpindex Foo 54
SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN 54
And finally the log file contains the following:
# Logfile created on Wed Jan 18 23:10:19 Eastern Standard Time 2006 by
logger.rb /1.5.2.4
[4;36;1mSQL (0.000000) [0;1mDBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
There is already an object named ''schema_info'' in the
database.
HRESULT error code:0x80020009
Exception occurred.: CREATE TABLE schema_info (version int)
[4;35;1mSQL (0.000000) DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
There is already an object named ''schema_info'' in the
database.
HRESULT error code:0x80020009
Exception occurred.: CREATE TABLE schema_info (version int)
[4;36;1mSQL (0.000000) [0;1mSELECT COLUMN_NAME as ColName,
COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType,
COL_LENGTH(''schema_info'', COLUMN_NAME) as Length,
COLUMNPROPERTY(OBJECT_ID(''schema_info''), COLUMN_NAME,
''IsIdentity'') as
IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME = ''schema_info''
[4;35;1mSQL (0.000000) SELECT TOP 1 version FROM
schema_info
[4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 version FROM
schema_info
Migrating to AddFooTable (2)
[4;35;1mSQL (0.000000) CREATE TABLE Foo ([id] int NOT NULL
IDENTITY(1, 1) PRIMARY KEY, [Name] varchar(50))
[4;36;1mSQL ( 0.000000) [0;1mSELECT @@ROWCOUNT AS AffectedRows
[4;35;1mSQL (0.000000) UPDATE schema_info SET version = 2
[4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 * FROM schema_info
[4;35;1mSQL (0.000000) SELECT table_name from
information_schema.tables WHERE table_type = ''BASE TABLE''
[4;36;1mSQL (0.020000) [0;1mSELECT COLUMN_NAME as ColName,
COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType,
COL_LENGTH(''Foo'',
COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID(''Foo''),
COLUMN_NAME,
''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''Foo''
[4;35;1mSQL (0.000000) EXEC sp_helpindex Foo
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/cc9fc7f1/attachment-0001.html
I''ve used migrations successfully with SQL Server. I don''t see what is causing you trouble here. Have you dropped the database, recreated it and then run migrations? Jamie On Jan 18, 2006, at 11:25 PM, Steve Eichert wrote:> Is anyone using migrations with a SQL Server database who might be > able to lend me a hand? I''ve used migrations with MySql in the > past and haven''t run into any issues so forgive When I run rake > migrate nothing is actually getting updated in my database. I > created a migration using ./script/generate migration AddFooTable > and updated the migration to look as follows: > > class AddFooTable < ActiveRecord::Migration > def self.up > create_table "Foo" do |t| > t.column "Name", :string, :limit => 50 > end > end > > def self.down > drop_table "Foo" > end > end > > When I run rake migrate the database doesn''t get updated. My new > table doesn''t show up and my schema_info version doesn''t get > updated. I have a couple questions: > > 1) Why would the schema_info table be created multiple times (at > least attempted?). > 2) Why isn''t an error be shown after I run rake migrate if the > migration is failing? Where can I look for more details? > 3) Does anyone have any ideas as to what might be going wrong? > > FYI, I have the following in my environment.rb file: > ActiveRecord::Base.connection.instance_variable_get("@connection") > ["AutoCommit"] = false > > The trace when I run rake migrate --trace is as follows: > ** Invoke migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute migrate > ** Invoke db_schema_dump (first_time) > ** Invoke environment > ** Execute db_schema_dump > > The following SQL is executed: > > Audit Login -- network protocol: TCP/IP > set quoted_identifier on > set implicit_transactions off > set cursor_close_on_commit off > set ansi_warnings on > set ansi_padding on > set ansi_nulls on > set concat_null_yields_null on > set language us_english > set dateformat mdy > set datefirst 7 > 54 > SQL:BatchCompleted set implicit_transactions on 54 > SQL:BatchCompleted SELECT 1 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info > (version int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info > (version int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info > (version int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info > (version int) 54 > SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT > as DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''schema_info'', > COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID(''schema_info''), > COLUMN_NAME, ''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale > FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''schema_info'' 54 > SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54 > SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54 > SQL:BatchCompleted CREATE TABLE Foo ([id] int NOT NULL IDENTITY > (1, 1) PRIMARY KEY, [Name] varchar(50)) 54 > SQL:BatchCompleted UPDATE schema_info SET version = 2 54 > SQL:BatchCompleted SELECT @@ROWCOUNT AS AffectedRows 54 > SQL:BatchCompleted SELECT TOP 1 * FROM schema_info 54 > SQL:BatchCompleted SELECT table_name from > information_schema.tables WHERE table_type = ''BASE TABLE'' 54 > SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT > as DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''Foo'', > COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID(''Foo''), > COLUMN_NAME, ''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale > FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''Foo'' 54 > SQL:BatchCompleted EXEC sp_helpindex Foo 54 > SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN 54 > > > And finally the log file contains the following: > > # Logfile created on Wed Jan 18 23:10:19 Eastern Standard Time 2006 > by logger.rb /1.5.2.4 > [4;36;1mSQL (0.000000) [0;1mDBI::DatabaseError: Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > There is already an object named ''schema_info'' in the database. > HRESULT error code:0x80020009 > Exception occurred.: CREATE TABLE schema_info (version int) > [4;35;1mSQL (0.000000) DBI::DatabaseError: Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > There is already an object named ''schema_info'' in the database. > HRESULT error code:0x80020009 > Exception occurred.: CREATE TABLE schema_info (version int) > [4;36;1mSQL (0.000000) [0;1mSELECT COLUMN_NAME as > ColName, COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType, > COL_LENGTH(''schema_info'', COLUMN_NAME) as Length, COLUMNPROPERTY > (OBJECT_ID(''schema_info''), COLUMN_NAME, ''IsIdentity'') as > IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS > WHERE TABLE_NAME = ''schema_info'' > [4;35;1mSQL (0.000000) SELECT TOP 1 version FROM > schema_info > [4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 version FROM > schema_info > Migrating to AddFooTable (2) > [4;35;1mSQL (0.000000) CREATE TABLE Foo ([id] int NOT > NULL IDENTITY(1, 1) PRIMARY KEY, [Name] varchar(50)) > [4;36;1mSQL ( 0.000000) [0;1mSELECT @@ROWCOUNT AS > AffectedRows > [4;35;1mSQL (0.000000) UPDATE schema_info SET version > = 2 > [4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 * FROM > schema_info > [4;35;1mSQL (0.000000) SELECT table_name from > information_schema.tables WHERE table_type = ''BASE TABLE'' > [4;36;1mSQL (0.020000) [0;1mSELECT COLUMN_NAME as > ColName, COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType, > COL_LENGTH(''Foo'', COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID > (''Foo''), COLUMN_NAME, ''IsIdentity'') as IsIdentity, NUMERIC_SCALE as > Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''Foo'' > [4;35;1mSQL (0.000000) EXEC sp_helpindex Foo > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/1be26cb2/attachment.html
I think the problem is actually do to the fact that I have the following in my environment.rb file: config.active_record.schema_format = :ruby If I comment out this line I can run migrations. If I try and do a db_schema_dump after doing my initial db_schema_import things crap out so I''m guessing there''s something with the way the database was created via the db_schema_dump initially that is causing the problem. As I find out more information about where and what is cuasing the problems I''ll probably return to the list to find out why :) - Steve On 1/19/06, Jamie Orchard-Hays <jamie@dang.com> wrote:> > I''ve used migrations successfully with SQL Server. I don''t see what is > causing you trouble here. Have you dropped the database, recreated it and > then run migrations? > Jamie > > > On Jan 18, 2006, at 11:25 PM, Steve Eichert wrote: > > Is anyone using migrations with a SQL Server database who might be able to > lend me a hand? I''ve used migrations with MySql in the past and haven''t > run into any issues so forgive When I run rake migrate nothing is actually > getting updated in my database. I created a migration using > ./script/generate migration AddFooTable and updated the migration to look as > follows: > > class AddFooTable < ActiveRecord::Migration > def self.up > create_table "Foo" do |t| > t.column "Name", :string, :limit => 50 > end > end > > def self.down > drop_table "Foo" > end > end > > When I run rake migrate the database doesn''t get updated. My new table > doesn''t show up and my schema_info version doesn''t get updated. I have a > couple questions: > > 1) Why would the schema_info table be created multiple times (at least > attempted?). > 2) Why isn''t an error be shown after I run rake migrate if the migration > is failing? Where can I look for more details? > 3) Does anyone have any ideas as to what might be going wrong? > > FYI, I have the following in my environment.rb file: ActiveRecord:: > Base.connection.instance_variable_get("@connection")["AutoCommit"] = false > > > The trace when I run rake migrate --trace is as follows: > ** Invoke migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute migrate > ** Invoke db_schema_dump (first_time) > ** Invoke environment > ** Execute db_schema_dump > > The following SQL is executed: > > Audit Login -- network protocol: TCP/IP > set quoted_identifier on > set implicit_transactions off > set cursor_close_on_commit off > set ansi_warnings on > set ansi_padding on > set ansi_nulls on > set concat_null_yields_null on > set language us_english > set dateformat mdy > set datefirst 7 > 54 > SQL:BatchCompleted set implicit_transactions on 54 > SQL:BatchCompleted SELECT 1 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info (version > int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info (version > int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info (version > int) 54 > SQL:BatchCompleted CREATE TABLE schema_info (version int) 54 > SQL:BatchCompleted select * from CREATE TABLE schema_info (version > int) 54 > SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as > DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''schema_info'', COLUMN_NAME) > as Length, COLUMNPROPERTY(OBJECT_ID(''schema_info''), COLUMN_NAME, > ''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM > INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''schema_info'' 54 > SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54 > SQL:BatchCompleted SELECT TOP 1 version FROM schema_info 54 > SQL:BatchCompleted CREATE TABLE Foo ([id] int NOT NULL IDENTITY(1, 1) > PRIMARY KEY, [Name] varchar(50)) 54 > SQL:BatchCompleted UPDATE schema_info SET version = 2 54 > SQL:BatchCompleted SELECT @@ROWCOUNT AS AffectedRows 54 > SQL:BatchCompleted SELECT TOP 1 * FROM schema_info 54 > SQL:BatchCompleted SELECT table_name from information_schema.tables > WHERE table_type = ''BASE TABLE'' 54 > SQL:BatchCompleted SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT as > DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''Foo'', COLUMN_NAME) as > Length, COLUMNPROPERTY(OBJECT_ID(''Foo''), COLUMN_NAME, ''IsIdentity'') as > IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE > TABLE_NAME = ''Foo'' 54 > SQL:BatchCompleted EXEC sp_helpindex Foo 54 > SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN 54 > > > And finally the log file contains the following: > > # Logfile created on Wed Jan 18 23:10:19 Eastern Standard Time 2006 by > logger.rb /1.5.2.4 > [4;36;1mSQL (0.000000) [0;1mDBI::DatabaseError: Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > There is already an object named ''schema_info'' in the database. > HRESULT error code:0x80020009 > Exception occurred.: CREATE TABLE schema_info (version int) > [4;35;1mSQL (0.000000) DBI::DatabaseError: Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > There is already an object named ''schema_info'' in the database. > HRESULT error code:0x80020009 > Exception occurred.: CREATE TABLE schema_info (version int) > [4;36;1mSQL (0.000000) [0;1mSELECT COLUMN_NAME as ColName, > COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType, > COL_LENGTH(''schema_info'', COLUMN_NAME) as Length, > COLUMNPROPERTY(OBJECT_ID(''schema_info''), COLUMN_NAME, ''IsIdentity'') as > IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE > TABLE_NAME = ''schema_info'' > [4;35;1mSQL (0.000000) SELECT TOP 1 version FROM > schema_info > [4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 version FROM > schema_info > Migrating to AddFooTable (2) > [4;35;1mSQL (0.000000) CREATE TABLE Foo ([id] int NOT NULL > IDENTITY(1, 1) PRIMARY KEY, [Name] varchar(50)) > [4;36;1mSQL ( 0.000000) [0;1mSELECT @@ROWCOUNT AS > AffectedRows > [4;35;1mSQL (0.000000) UPDATE schema_info SET version = 2 > [4;36;1mSQL (0.000000) [0;1mSELECT TOP 1 * FROM schema_info > [4;35;1mSQL (0.000000) SELECT table_name from > information_schema.tables WHERE table_type = ''BASE TABLE'' > [4;36;1mSQL (0.020000) [0;1mSELECT COLUMN_NAME as ColName, > COLUMN_DEFAULT as DefaultValue, DATA_TYPE as ColType, COL_LENGTH(''Foo'', > COLUMN_NAME) as Length, COLUMNPROPERTY(OBJECT_ID(''Foo''), COLUMN_NAME, > ''IsIdentity'') as IsIdentity, NUMERIC_SCALE as Scale FROM > INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''Foo'' > [4;35;1mSQL (0.000000) EXEC sp_helpindex Foo > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/d8413f17/attachment-0001.html