Odyssey
tools
cumanage
db
migrations
2018111300_AddCUJobsSequences.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
AddCUJobsSequences
extends
AbstractMigration {
11
public
function
up() {
12
// Set sequence for cutrack
13
$sql =
"CREATE SEQUENCE IF NOT EXISTS cutrack_track_id_seq"
;
14
$this->query($sql);
15
16
$sql =
"SELECT pg_catalog.setval('cutrack_track_id_seq', 1, false);"
;
17
$this->query($sql);
18
19
// Set sequence for cutrackitem
20
$sql =
"CREATE SEQUENCE IF NOT EXISTS cutrackitem_trackitem_id_seq"
;
21
$this->query($sql);
22
23
$sql =
"SELECT pg_catalog.setval('cutrackitem_trackitem_id_seq', 1, false);"
;
24
$this->query($sql);
25
}
// End "up" function.
26
27
public
function
down() {
28
29
}
// End "down" function
30
}
AddCUJobsSequences
Definition:
2018111300_AddCUJobsSequences.php:10
Generated by
1.8.15