1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

Merge pull request #38 from finn-no/finn-specific-db-init

Added finn-specific prepare as a db-migration
This commit is contained in:
Jari Bakken 2014-10-31 16:05:07 +01:00
commit 3748ae61ee
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;