7 use Phinx\Migration\AbstractMigration;
15 public function up() {
19 $cuList = $this->fetchAll(
'SELECT cu FROM cuadmin');
21 for ( $i = 0; $i < count( $cuList ); $i++ ) {
22 $cu = strtolower( trim( $cuList[$i][
"cu"] ) );
27 $tableName =
"{$cu}crossaccounts";
29 $exists = $this->hasTable($tableName);
38 CREATE TABLE {$tableName} ( 39 accountnumber character (12) NOT NULL, 40 tomember character(12) NOT NULL, 41 accounttype character(12) NOT NULL, 42 deposittype character (1) NOT NULL, 43 description character varying (255), 44 misc1 character varying (255) 46 $sqlRs = $this->query($sql);
49 $sql =
"ALTER TABLE ONLY {$tableName} ADD CONSTRAINT {$tableName}_pkey PRIMARY KEY (accountnumber, tomember, accounttype, deposittype);";
50 $sqlRs = $this->query($sql);