add fingerpint rest

This commit is contained in:
2020-01-06 10:50:57 +01:00
parent 14a5fbed33
commit b05f861667
13 changed files with 637 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
use yii\db\Migration;
/**
* Class m200103_104020_add_table_fingerprint
*/
class m200103_104020_add_table_fingerprint extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$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('{{%fingerprint}}', [
'id_fingerprint' => $this->primaryKey(),
'id_customer' => $this->integer(11),
'fingerprint' => $this->text(),
'created_at' => $this->dateTime()->notNull(),
'updated_at' => $this->dateTime()->notNull(),
], $tableOptions);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
echo "m200103_104020_add_table_fingerprint cannot be reverted.\n";
return false;
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m200103_104020_add_table_fingerprint cannot be reverted.\n";
return false;
}
*/
}