-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change schema of OperatorBundle to include field 'bundlepath'.
Migrate older database to new schema. Extend API to allow querying of the new `bundlepath` field.
- Loading branch information
Showing
12 changed files
with
359 additions
and
101 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
5 changes: 5 additions & 0 deletions
5
pkg/sqlite/db_migrations/20191021125829_add_bundle_path.down.sql
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,5 @@ | ||
/* TODO: Make this idempotent */ | ||
ALTER TABLE operatorbundle | ||
ADD COLUMN bundlepath TEXT | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
pkg/sqlite/db_migrations/20191021125829_add_bundle_path.up.sql
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,10 @@ | ||
BEGIN TRANSACTION; | ||
PRAGMA foreign_keys = 0; | ||
CREATE TEMPORARY TABLE operatorbundle_backup (name TEXT,csv TEXT,bundle TEXT); | ||
INSERT INTO operatorbundle_backup SELECT name,csv,bundle FROM operatorbundle; | ||
DROP TABLE operatorbundle; | ||
CREATE TABLE operatorbundle(name TEXT,csv TEXT,bundle TEXT); | ||
INSERT INTO operatorbundle SELECT name,csv,bundle FROM operatorbundle_backup; | ||
DROP TABLE operatorbundle_backup; | ||
PRAGMA foreign_keys = 1; | ||
COMMIT; |
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
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