mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
Added finn-specific prepare as a db-migration
This commit is contained in:
parent
0256d357eb
commit
2f14e86fc8
@ -19,8 +19,3 @@ CREATE TABLE events (
|
||||
created_by varchar(255) NOT NULL,
|
||||
data json
|
||||
);
|
||||
|
||||
GRANT ALL ON TABLE events TO unleash_user;
|
||||
GRANT ALL ON TABLE features TO unleash_user;
|
||||
GRANT ALL ON TABLE strategies TO unleash_user;
|
||||
GRANT USAGE, SELECT ON SEQUENCE events_id_seq TO unleash_user;
|
||||
|
@ -24,6 +24,8 @@ fs.readdir(sqlRoot, function (err, files) {
|
||||
|
||||
var changes = {};
|
||||
|
||||
initialInit(changes);
|
||||
|
||||
files.forEach(function (sqlFile) {
|
||||
var match = sqlFile.match(/(.+?)\.(up|down)\.sql/);
|
||||
|
||||
@ -49,3 +51,9 @@ fs.readdir(sqlRoot, function (err, files) {
|
||||
util.puts(changeLog.end({pretty: true}));
|
||||
});
|
||||
|
||||
function initialInit(changes) {
|
||||
changes["init-prepare"] = {};
|
||||
changes["init-prepare"]["up"] = fs.readFileSync(path.resolve(__dirname, './init.up.sql'), {encoding: encoding});
|
||||
changes["init-prepare"]["down"] = fs.readFileSync(path.resolve(__dirname, './init.down.sql'), {encoding: encoding});
|
||||
}
|
||||
|
||||
|
2
unleash-server/scripts/init.down.sql
Normal file
2
unleash-server/scripts/init.down.sql
Normal file
@ -0,0 +1,2 @@
|
||||
alter default privileges for user unleash_admin revoke select,insert,update,delete on tables TO unleash_user;
|
||||
alter default privileges for user unleash_admin revoke select,update on sequences TO unleash_user;
|
2
unleash-server/scripts/init.up.sql
Normal file
2
unleash-server/scripts/init.up.sql
Normal file
@ -0,0 +1,2 @@
|
||||
alter default privileges for user unleash_admin grant select,insert,update,delete on tables TO unleash_user;
|
||||
alter default privileges for user unleash_admin grant select,update on sequences TO unleash_user;
|
Loading…
Reference in New Issue
Block a user