add contraint , that everybody expect admin is limited to 3 days, Add card package

This commit is contained in:
2016-02-13 17:23:43 +01:00
parent 556bdc3066
commit 70f43468af
37 changed files with 1418 additions and 19 deletions

View File

@@ -0,0 +1,50 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160211_111418_create__table__card_package extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%card_package}}', [
'id_card_package' => $this->primaryKey(),
'id_user' => $this->integer(11),
'count' => $this->integer(11),
'created_at' => $this->dateTime()->notNull(),
'updated_at' => $this->dateTime()->notNull(),
], $tableOptions);
$this->createTable('{{%card_card_package_assignment}}', [
'id_card_card_package_assignment' => $this->primaryKey(),
'id_card_package' => $this->integer(11),
'id_card' => $this->integer(11),
'created_at' => $this->dateTime()->notNull(),
'updated_at' => $this->dateTime()->notNull(),
], $tableOptions);
}
public function down()
{
echo "m160211_111418_create__table__card_package cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@@ -0,0 +1,30 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160212_051248_alter__table__card_package__add_column_printed extends Migration
{
public function up()
{
$this->addColumn("card_package", "printed", "int");
}
public function down()
{
echo "m160212_051248_alter__table__card_package__add_column_printed cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}