You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous design allows migration in any file, which has to be visited before migration is applied, or it requires us to watch for on save event and apply the migration. The on save event is unreliable as we may be using fastn with files directly on filesystem etc (where on save may not be relied upon).
So we will store migrations in FASTN.ftd file instead. Also instead of ftd.migration, it would be called fastn.migration.
Earlier Design
Any file can contain:
;; name is unique id of this migration
;; migrations are applied in the order specified in this file
-- ftd.migration: name
create table ..
create table ..
-- ftd.migration: name
update table ..
create table ..
If someone modifies an applied migration (name or query) it is an error. If existing migrations are re-ordered after being applied its an error. If a new migration is added in the beginning or before last applied migration, again an error.
Convetion: migration.ftd. For now we will not auto run this and someone will have to visit the /migration/ url to apply the migrations. In future the we can auto run it on save.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Update
The previous design allows migration in any file, which has to be visited before migration is applied, or it requires us to watch for on save event and apply the migration. The on save event is unreliable as we may be using fastn with files directly on filesystem etc (where on save may not be relied upon).
So we will store migrations in FASTN.ftd file instead. Also instead of
ftd.migration
, it would be calledfastn.migration
.Earlier Design
Any file can contain:
If someone modifies an applied migration (name or query) it is an error. If existing migrations are re-ordered after being applied its an error. If a new migration is added in the beginning or before last applied migration, again an error.
Convetion:
migration.ftd
. For now we will not auto run this and someone will have to visit the /migration/ url to apply the migrations. In future the we can auto run it on save.Beta Was this translation helpful? Give feedback.
All reactions