Is it a good idea to purge old Rails migration files?

The Rails 4 Way page 177: Sebastian says… A little-known fact is that you can remove old migration files (while still keeping newer ones) to keep the db/migrate folder to a manageable size. You can move the older migrations to a db/archived_migrations folder or something like that. Once you do trim the size of your … Read more

Array Attribute for Ruby Model

Create a model with a text field > rails g model Arches thearray:text invoke active_record create db/migrate/20111111174052_create_arches.rb create app/models/arches.rb invoke test_unit create test/unit/arches_test.rb create test/fixtures/arches.yml > rake db:migrate == CreateArches: migrating =================================================== — create_table(:arches) -> 0.0012s == CreateArches: migrated (0.0013s) ========================================== edit your model to make the field serialized to an array class Arches < … Read more

Can Rails Migrations be used to convert data?

What you’re trying to do is possible, and I would say the correct thing to do. You need, though, to reload the column info for the model classes you’re updating in the migration, so that Rails knows about the new columns. Try this: def.self up add_column :users, :age_text, :string User.reset_column_information users = User.find(:all) users.each do … Read more

Rails: Is the version number in ‘schema.rb’ used for anything?

Actually, the version is much more important than this. The code you’ve cited is actually only a small part of what assume_migrated_upto_version does. The real effect of the migration version is that all prior migrations (as found in the db/migrate directory) are assumed to have been run. (So yes, it does what the function name … Read more

Laravel migration primary (or key) “Identifier name is too long”

Simply specify the key name when creating it (with the second argument for primary). $table->primary([‘column_1’, ‘column_2’, ‘column_3’], ‘my_long_table_primary’); Next, If you have error like You have an error in your SQL syntax … after this modification please make sure you are not using reserved word by your database engine for your key name. Eg for … Read more

Deploying a Jersey webapp on Jboss AS 7

it has already been mentioned in this post : https://community.jboss.org/message/744530#744530 , you can just ask the resteasy module to not scan for other JAX RS implementations in your webapp; just add this to your web.xml : <context-param> <param-name>resteasy.scan</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.scan.providers</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.scan.resources</param-name> <param-value>false</param-value> </context-param> worked fine for me

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)