Added grants to sequences in the migration scripts

This commit is contained in:
bison-paolo
2016-10-06 16:54:56 +02:00
parent 00143e4c38
commit 044cfb8819
3 changed files with 141 additions and 132 deletions
+53 -50
View File
@@ -1,8 +1,8 @@
<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
if (! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH . "/libraries/MigrationLib.php";
require_once APPPATH . '/libraries/MigrationLib.php';
class Migration_Bewerbungsfrist extends MigrationLib
{
@@ -17,70 +17,73 @@ class Migration_Bewerbungsfrist extends MigrationLib
// Create table lehre.tbl_bewerbungsfrist
$fields = array(
"bewerbungsfrist_id" => array(
"type" => "integer",
"auto_increment" => true
'bewerbungsfrist_id' => array(
'type' => 'integer',
'auto_increment' => true
),
"studiensemester_kurzbz" => array(
"type" => "varchar(16)"
'studiensemester_kurzbz' => array(
'type' => 'varchar(16)'
),
"begin" => array(
"type" => "date"
'begin' => array(
'type' => 'date'
),
"ende" => array(
"type" => "date"
'ende' => array(
'type' => 'date'
),
"ende" => array(
"type" => "date"
'ende' => array(
'type' => 'date'
),
"nachfrist" => array(
"type" => "boolean DEFAULT FALSE",
"null" => true
'nachfrist' => array(
'type' => 'boolean DEFAULT FALSE',
'null' => true
),
"nachfristende" => array(
"type" => "date",
"null" => true
'nachfristende' => array(
'type' => 'date',
'null' => true
),
"anmerkung" => array(
"type" => "text"
'anmerkung' => array(
'type' => 'text'
),
"insertamum" => array(
"type" => "timestamp DEFAULT NOW()",
"null" => true
'insertamum' => array(
'type' => 'timestamp DEFAULT NOW()',
'null' => true
),
"insertvon" => array(
"type" => "varchar(32)",
"null" => true
'insertvon' => array(
'type' => 'varchar(32)',
'null' => true
),
"updateamum" => array(
"type" => "timestamp DEFAULT NOW()",
"null" => true
'updateamum' => array(
'type' => 'timestamp DEFAULT NOW()',
'null' => true
),
"updatevon" => array(
"type" => "varchar(32)",
"null" => true
'updatevon' => array(
'type' => 'varchar(32)',
'null' => true
)
);
$this->createTable("lehre", "tbl_bewerbungsfrist", $fields);
$this->createTable('lehre', 'tbl_bewerbungsfrist', $fields);
$this->addPrimaryKey(
"lehre",
"tbl_bewerbungsfrist",
"pk_tbl_bewerbungsfrist",
array("bewerbungsfrist_id")
'lehre',
'tbl_bewerbungsfrist',
'pk_tbl_bewerbungsfrist',
array('bewerbungsfrist_id')
);
$this->addForeingKey(
"lehre",
"tbl_bewerbungsfrist",
"fk_bewerbungsfrist_studiensemester_kurzbz",
"studiensemester_kurzbz",
"public",
"tbl_studiensemester",
"studiensemester_kurzbz",
"ON UPDATE CASCADE ON DELETE RESTRICT"
'lehre',
'tbl_bewerbungsfrist',
'fk_bewerbungsfrist_studiensemester_kurzbz',
'studiensemester_kurzbz',
'public',
'tbl_studiensemester',
'studiensemester_kurzbz',
'ON UPDATE CASCADE ON DELETE RESTRICT'
);
$this->grantTable("SELECT", "lehre", "tbl_bewerbungsfrist", "web");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "lehre", "tbl_bewerbungsfrist", "admin");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "lehre", "tbl_bewerbungsfrist", "vilesci");
$this->grantTable('SELECT', 'lehre', 'tbl_bewerbungsfrist', 'web');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'admin');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'vilesci');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'web');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'admin');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'vilesci');
$this->endUP();
}
@@ -89,7 +92,7 @@ class Migration_Bewerbungsfrist extends MigrationLib
{
$this->startDown();
$this->dropTable("lehre", "tbl_bewerbungsfrist");
$this->dropTable('lehre', 'tbl_bewerbungsfrist');
$this->endDown();
}
+53 -50
View File
@@ -1,8 +1,8 @@
<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
if (! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH . "/libraries/MigrationLib.php";
require_once APPPATH . '/libraries/MigrationLib.php';
class Migration_Bewerbungsfrist2 extends MigrationLib
{
@@ -15,7 +15,7 @@ class Migration_Bewerbungsfrist2 extends MigrationLib
{
$this->startUP();
$this->dropTable("lehre", "tbl_bewerbungsfrist");
$this->dropTable('lehre', 'tbl_bewerbungsfrist');
$this->endUP();
}
@@ -26,70 +26,73 @@ class Migration_Bewerbungsfrist2 extends MigrationLib
// Create table lehre.tbl_bewerbungsfrist
$fields = array(
"bewerbungsfrist_id" => array(
"type" => "integer",
"auto_increment" => true
'bewerbungsfrist_id' => array(
'type' => 'integer',
'auto_increment' => true
),
"studiensemester_kurzbz" => array(
"type" => "varchar(16)"
'studiensemester_kurzbz' => array(
'type' => 'varchar(16)'
),
"begin" => array(
"type" => "date"
'begin' => array(
'type' => 'date'
),
"ende" => array(
"type" => "date"
'ende' => array(
'type' => 'date'
),
"ende" => array(
"type" => "date"
'ende' => array(
'type' => 'date'
),
"nachfrist" => array(
"type" => "boolean DEFAULT FALSE",
"null" => true
'nachfrist' => array(
'type' => 'boolean DEFAULT FALSE',
'null' => true
),
"nachfristende" => array(
"type" => "date",
"null" => true
'nachfristende' => array(
'type' => 'date',
'null' => true
),
"anmerkung" => array(
"type" => "text"
'anmerkung' => array(
'type' => 'text'
),
"insertamum" => array(
"type" => "timestamp DEFAULT NOW()",
"null" => true
'insertamum' => array(
'type' => 'timestamp DEFAULT NOW()',
'null' => true
),
"insertvon" => array(
"type" => "varchar(32)",
"null" => true
'insertvon' => array(
'type' => 'varchar(32)',
'null' => true
),
"updateamum" => array(
"type" => "timestamp DEFAULT NOW()",
"null" => true
'updateamum' => array(
'type' => 'timestamp DEFAULT NOW()',
'null' => true
),
"updatevon" => array(
"type" => "varchar(32)",
"null" => true
'updatevon' => array(
'type' => 'varchar(32)',
'null' => true
)
);
$this->createTable("lehre", "tbl_bewerbungsfrist", $fields);
$this->createTable('lehre', 'tbl_bewerbungsfrist', $fields);
$this->addPrimaryKey(
"lehre",
"tbl_bewerbungsfrist",
"pk_tbl_bewerbungsfrist",
array("bewerbungsfrist_id")
'lehre',
'tbl_bewerbungsfrist',
'pk_tbl_bewerbungsfrist',
array('bewerbungsfrist_id')
);
$this->addForeingKey(
"lehre",
"tbl_bewerbungsfrist",
"fk_bewerbungsfrist_studiensemester_kurzbz",
"studiensemester_kurzbz",
"public",
"tbl_studiensemester",
"studiensemester_kurzbz",
"ON UPDATE CASCADE ON DELETE RESTRICT"
'lehre',
'tbl_bewerbungsfrist',
'fk_bewerbungsfrist_studiensemester_kurzbz',
'studiensemester_kurzbz',
'public',
'tbl_studiensemester',
'studiensemester_kurzbz',
'ON UPDATE CASCADE ON DELETE RESTRICT'
);
$this->grantTable("SELECT", "lehre", "tbl_bewerbungsfrist", "web");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "lehre", "tbl_bewerbungsfrist", "admin");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "lehre", "tbl_bewerbungsfrist", "vilesci");
$this->grantTable('SELECT', 'lehre', 'tbl_bewerbungsfrist', 'web');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'admin');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'vilesci');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'web');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'admin');
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'vilesci');
$this->endDown();
}
+35 -32
View File
@@ -1,8 +1,8 @@
<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
if (! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH . "/libraries/MigrationLib.php";
require_once APPPATH . '/libraries/MigrationLib.php';
class Migration_Status_grund extends MigrationLib
{
@@ -16,44 +16,47 @@ class Migration_Status_grund extends MigrationLib
$this->startUP();
$fields = array(
"statusgrund_kurzbz" => array(
"type" => "integer",
"auto_increment" => true
'statusgrund_kurzbz' => array(
'type' => 'integer',
'auto_increment' => true
),
"status_kurzbz" => array(
"type" => "varchar(20)"
'status_kurzbz' => array(
'type' => 'varchar(20)'
),
"aktiv" => array(
"type" => "boolean DEFAULT FALSE",
"null" => true
'aktiv' => array(
'type' => 'boolean DEFAULT FALSE',
'null' => true
),
"bezeichnung_mehrsprachig" => array(
"type" => "varchar(255)[]"
'bezeichnung_mehrsprachig' => array(
'type' => 'varchar(255)[]'
),
"beschreibung" => array(
"type" => "text[]"
'beschreibung' => array(
'type' => 'text[]'
)
);
$this->createTable("public", "tbl_status_grund", $fields);
$this->createTable('public', 'tbl_status_grund', $fields);
$this->addPrimaryKey(
"public",
"tbl_status_grund",
"pk_tbl_status_grund",
array("statusgrund_kurzbz")
'public',
'tbl_status_grund',
'pk_tbl_status_grund',
array('statusgrund_kurzbz')
);
$this->addForeingKey(
"public",
"tbl_status_grund",
"fk_status_grundstatus_kurzbz",
"status_kurzbz",
"public",
"tbl_status",
"status_kurzbz",
"ON UPDATE CASCADE ON DELETE RESTRICT"
'public',
'tbl_status_grund',
'fk_status_grundstatus_kurzbz',
'status_kurzbz',
'public',
'tbl_status',
'status_kurzbz',
'ON UPDATE CASCADE ON DELETE RESTRICT'
);
$this->grantTable("SELECT", "public", "tbl_status_grund", "web");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_status_grund", "admin");
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_status_grund", "vilesci");
$this->grantTable('SELECT', 'public', 'tbl_status_grund', 'web');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'public', 'tbl_status_grund', 'admin');
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'public', 'tbl_status_grund', 'vilesci');
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'web');
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'admin');
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'vilesci');
$this->endUP();
}
@@ -62,8 +65,8 @@ class Migration_Status_grund extends MigrationLib
{
$this->startDown();
$this->dropTable("public", "tbl_status_grund");
$this->dropTable('public', 'tbl_status_grund');
$this->endDown();
}
}
}