varchar Migration question for Ruby on Rails

The correct format would be t.string :note, :limit => 1000 make sure you are using a version of MySQL(or whichever database) which supports varchars longer than 256 characters. if you want to use a large text block it would be t.text :note See http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html for more information

Liquibase or Flyway database migration alternative for Elasticsearch

From this point of view/need, ES have a huge limitations: despite having dynamic mapping, ES is not schemaless but schema-intensive. Mappings cant be changed in case when this change conflicting with existing documents (practically, if any of documents have not-null field which new mapping affects, this will result in exception) documents in ES is immutable: …

Read more

Laravel relationships in migrations?

When creating a migration you can specify foreign keys on your tables, i.e. public function up() { Schema::table(‘roles’, function(Blueprint $table) { $table->increments(‘id’); $table->integer(‘user_id’)->unsigned(); //rest of fields then… $table->foreign(‘user_id’)->references(‘id’)->on(‘users’); }); } This will create a foreign key on the user_id column on the roles table. The benefits of foreign keys is that when an update or …

Read more