Odyssey
tools
cumanage
db
migrations
2018121300_AddTablesMenuSequences.php
1
<?php
2
/**
3
* Notes:
4
* 1. Anything complicated needs to be done with SQL.
5
* 2. Always have a check to know if the migration needs to occur (up or down).
6
* 3. Use up() and down(), not change(), because of the SQL
7
*/
8
use Phinx\Migration\AbstractMigration;
9
10
class
AddTablesMenuSequences
extends
AbstractMigration {
11
public
function
up() {
12
// Set sequence for cuquestmaster
13
$sql =
"CREATE SEQUENCE IF NOT EXISTS cuquestmaster_quest_id_seq;"
;
14
$this->query($sql);
15
16
$sql =
"SELECT pg_catalog.setval('cuquestmaster_quest_id_seq', 66, false);"
;
17
$this->query($sql);
18
19
// Set sequence for cuissues
20
$sql =
"CREATE SEQUENCE IF NOT EXISTS cuissues_issue_id_seq;"
;
21
$this->query($sql);
22
23
$sql =
"SELECT pg_catalog.setval('cuissues_issue_id_seq', 1, false);"
;
24
$this->query($sql);
25
26
// Set sequence for cuissuesitem
27
$sql =
"CREATE SEQUENCE IF NOT EXISTS cuissuesitem_item_id_seq;"
;
28
$this->query($sql);
29
30
$sql =
"SELECT pg_catalog.setval('cuissuesitem_item_id_seq', 1, false);"
;
31
$this->query($sql);
32
}
// End "up" function.
33
34
public
function
down() {
35
36
}
// End "down" function
37
}
AddTablesMenuSequences
Definition:
2018121300_AddTablesMenuSequences.php:10
Generated by
1.8.15