This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces a new 'migrations' table in the database to keep track of executed database migrations. A 'migrations' section was also added accordingly in the 'databaseDriver.ts'. The migration files in the 'migrations' directory will now be sorted and executed in order. After a successful execution, the migration file information will be added to the 'migrations' table. This change was necessary to maintain the order and consistency of database migrations, and to prevent the re-execution of an already executed migration script.
- Loading branch information
Showing
3 changed files
with
142 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- example entry | ||
-- please use {number} - {name} as your format to keep migrations in an consistent order | ||
-- Top comment explaining why this is needed | ||
-- 'migrations' table to track executed DB migrations | ||
create table if not exists migrations | ||
( | ||
-- Each migration gets a unique ID | ||
id BIGINT AUTO_INCREMENT PRIMARY KEY, | ||
|
||
-- Timestamp of when the migration was executed | ||
createdAt timestamp default current_timestamp() not null, | ||
|
||
-- Name of the executed migration script | ||
filename varchar(255) not null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters