v2.0
There were some limitations of adding more engines (mainly related to go's lack of virtual methods). In v2 this was addressed.
The most important changes are:
- introduced Dialect interface to extract all vendor-specific SQL statements to separate implementations - a major overhaul of the whole project!
- added support fo Microsoft SQL Server
- made tests re-executable (by using dynamic assertions), increased test coverage, with 85%+ code coverage and many modules having 100% code coverage
- fixed all fmt, lint, and vet warnings
- merge migrator-docker image into main migrator project
Due to some changes required for MSSQL and new lint guidelines I had to make 2 breaking changes:
- Config File
The following 2 optional elements:
tenantSelectSql: XXX
tenantInsertSql: YYY
Now have capitalised SQL in their names. New correct form is:
tenantSelectSQL: XXX
tenantInsertSQL: YYY
- DB changes
MS SQL Server doesn't like public
and file
keywords. Thus a small adjustment in the naming convention had to be made.
Please add the following migration to migrator v2.0 or execute it manually before starting v2.0:
create schema if not exists migrator;
create table if not exists migrator.migrator_tenants (
id serial primary key,
name varchar(200) not null,
created timestamp default now()
);
insert into migrator.migrator_tenants (name, created) (select name, created from public.migrator_tenants);
drop table public.migrator_tenants;
create table if not exists migrator.migrator_migrations (
id serial primary key,
name varchar(200) not null,
source_dir varchar(200) not null,
filename varchar(200) not null,
type int not null,
db_schema varchar(200) not null,
created timestamp default now()
);
insert into migrator.migrator_migrations (name, source_dir, filename, type, db_schema, created) (select name, source_dir, file, type, db_schema, created from public.migrator_migrations);
drop table public.migrator_migrations;