mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 06:47:56 +00:00
Add basic database schema migration system
This commit is contained in:
parent
4d07886ec8
commit
4a30e56298
6 changed files with 92 additions and 34 deletions
15
PluralKit.Core/Migrations/1.sql
Normal file
15
PluralKit.Core/Migrations/1.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- SCHEMA VERSION 1: 2019-12-26
|
||||
-- First version introducing the migration system, therefore we add the info/version table
|
||||
|
||||
create table info
|
||||
(
|
||||
id int primary key not null default 1, -- enforced only equal to 1
|
||||
|
||||
schema_version int,
|
||||
|
||||
constraint singleton check (id = 1) -- enforce singleton table/row
|
||||
);
|
||||
|
||||
-- We do an insert here since we *just* added the table
|
||||
-- Future migrations should do an update at the end
|
||||
insert into info (schema_version) values (1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue