Re: [Rails] SQL constraints through migrations

2013-02-25 Thread Walter Lee Davis
On Feb 25, 2013, at 5:17 AM, Sumit Srivastava wrote: > Hi, > > I have to add contraints (CHECK) on a sql table through rails migration. How > should I? I googled and got to know about using something as follows, > > def self.up > execute "ALTER TABLE table_name ADD CONSTRAINT check_constra

[Rails] SQL constraints through migrations

2013-02-25 Thread Sumit Srivastava
Hi, I have to add contraints (CHECK) on a sql table through rails migration. How should I? I googled and got to know about using something as follows, def self.up execute "ALTER TABLE table_name ADD CONSTRAINT check_constraint_name CHECK (check_column_name IN (1, 2, 3) )" end But am not su