1
0
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:
Ivar Østhus 2014-10-30 20:32:02 +01:00
parent 0256d357eb
commit 2f14e86fc8
4 changed files with 12 additions and 5 deletions

View File

@ -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;

View File

@ -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});
}

View 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;

View 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;