Flyway 5.0.7 warning about using schema_version table

The default for flyway.table has been changed from schema_version to flyway_schema_history. And they have also provided automatic fallback to old default with a warning to avoid breaking existing installations using the old default. It means from flyway 5, If you do not specify flyway.table property inside your configuration file, then flyway will look for the … Read more

How to convert a postgres database to SQLite?

I found this blog entry which guides you to do these steps: Create a dump of the PostgreSQL database. ssh -C [email protected] pg_dump –data-only –inserts YOUR_DB_NAME > dump.sql Remove/modify the dump. Remove the lines starting with SET Remove the lines starting with SELECT pg_catalog.setval Replace true for ‘t’ Replace false for ‘f’ Add BEGIN; as … Read more

Rails migration does not change schema.rb

From the documentation: The rake db:reset task will drop the database, recreate it and load the current schema into it. This is not the same as running all the migrations. It will only use the contents of the current schema.rb file. If a migration can’t be rolled back, ‘rake db:reset’ may not help you. To … Read more

Running migrations with Rails in a Docker container with multiple container instances

Especially with Rails I don’t have any experience, but let’s look from a docker and software engineering point of view. The Docker team advocates, sometimes quite aggressively, that containers are about shipping applications. In this really great statement, Jerome Petazzoni says that it is all about separation of concerns. I feel that this is exactly … Read more

Using liquibase on the existing database

The process to put a existing database under liquibase control is the following: Create the initial changelog (that’s what you did) Run liquibase using the command changelogSync. This will create the Liquibase tables and mark all change sets as being applied (this is what you missed) Add your change sets Run liquibase using the command … Read more

Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys

It took a lot of fiddling about and testing different things. I was clueless until I decided to make a new vanilla project with the similar data structure from scratch. And when I installed EntityFramework from NuGet, I was shown a message: Known Issues with Entity Framework 4.x and .NET Framework 4.5 Entity Framework 4.1 … Read more

MySQL columns with DEFAULT NULL – stylistic choice, or is it?

As documented under Data Type Default Values: If the column can take NULL as a value, the column is defined with an explicit DEFAULT NULL clause. (I think they meant implicit, not explicit). Moreover, as documented under CREATE TABLE Syntax: If neither NULL nor NOT NULL is specified, the column is treated as though NULL … Read more

Flyway and liquibase together? [closed]

A small correction, before I answer question. The assumption Liquibase seems to have everything Flyway has isn’t correct. Flyway shines when it comes to parsing SQL. You can use unmodified SQL files generated by your native tools containing all kinds of complexity like PL/SQL packages and procedures, MySQL delimiter changes, T-SQL, PostgreSQL procedures, … With … Read more

Option for Cascade Delete for References or On Delete

This should work create_table :childs do |t| t.references :parent, index: true, foreign_key: {on_delete: :cascade} t.string :name t.timestamps null: false end According to ActiveRecord::ConnectionAdapters::TableDefinition#references, if a hash is specified on the foreign_key option, it is directly passed down into the foreign_key method. source: foreign_key(col.to_s.pluralize, foreign_key_options.is_a?(Hash) ? foreign_key_options : {}) if foreign_key_options