Hi, I''m trying to make a scaffold for my test application using PostgreSQL 8.3 database. and I remembered on an article for MySQL it uses :string for VARCHAR, :integer for INT, and :text for TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2. Is there any datatype equivalent with PostgreSQL? My database is like this workers: id serial (primary key) first_name character(50) last_name character(50) users: id serial (primary key) username character(20) password character(20) id_personnel integer(11) (foreign key related with the ''id'' field of the ''workers'' table) Additionally, is there a way to import or, rather, migrate the tables'' properties (their fields and datatypes) to rails? If there is any, that would be great, because my database is created and would like to use it without doing the "rake db:migrate" thing. I hope I''m not asking too much. Thanks in advance. Greetings... The Neurochild --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Migrations in Rails are independent from your DB. I have successfully migrated a Rails app from MySQL to PostgreSQL without having to change a single line of migration. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 25, 4:33 am, Fernando Perez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Migrations in Rails are independent from your DB. I have successfully > migrated a Rails app from MySQL to PostgreSQL without having to change a > single line of migration. > -- > Posted viahttp://www.ruby-forum.com/.And what about constraint (primary and foreign keys) and things like that. I know ":string" really mean "character varying" and I need the equivalent of the "character" data type, which is not present in the Rails''s data type. I hope to be wrong but another alternative would be to use the "execute" command followed by the SQL query. Is it possible to do so as mentioned in this article? http://www.robbyonrails.com/articles/2005/11/11/rails-migrations-and-postgresql-constraints. (Yeah I know it''s old but it can work on my project''s migrations) Later... The Neurochild --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---