forked from vieter-v/vieter
feat: added ability to specify kind of target
This commit is contained in:
parent
10ad8297fb
commit
bb5643bb03
6 changed files with 58 additions and 25 deletions
|
|
@ -16,9 +16,13 @@ const (
|
|||
migrations_up = [
|
||||
$embed_file('migrations/001-initial/up.sql'),
|
||||
$embed_file('migrations/002-rename-to-targets/up.sql'),
|
||||
$embed_file('migrations/003-target-url-type/up.sql'),
|
||||
]
|
||||
migrations_down = [
|
||||
$embed_file('migrations/001-initial/down.sql'),
|
||||
$embed_file('migrations/002-rename-to-targets/down.sql'),
|
||||
$embed_file('migrations/003-target-url-type/down.sql'),
|
||||
]
|
||||
migrations_down = [$embed_file('migrations/001-initial/down.sql'),
|
||||
$embed_file('migrations/002-rename-to-targets/down.sql')]
|
||||
)
|
||||
|
||||
// init initializes a database & adds the correct tables.
|
||||
|
|
|
|||
4
src/db/migrations/003-target-url-type/down.sql
Normal file
4
src/db/migrations/003-target-url-type/down.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
-- I'm not sure whether I should remove any non-git targets here. Keeping them
|
||||
-- will result in invalid targets, but removing them means losing data.
|
||||
ALTER TABLE Target DROP COLUMN kind;
|
||||
|
||||
1
src/db/migrations/003-target-url-type/up.sql
Normal file
1
src/db/migrations/003-target-url-type/up.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE Target ADD COLUMN kind TEXT NOT NULL DEFAULT 'git';
|
||||
Loading…
Add table
Add a link
Reference in a new issue