From c4380f65a5753ef41b463718ba7cfd235c1e2f3f Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 25 May 2013 00:23:07 +0400 Subject: [PATCH] MySQL migration for User model --- apps/advanced/console/migrations/.gitkeep | 1 - .../console/migrations/m130524_201442_init.php | 27 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) delete mode 100644 apps/advanced/console/migrations/.gitkeep create mode 100644 apps/advanced/console/migrations/m130524_201442_init.php diff --git a/apps/advanced/console/migrations/.gitkeep b/apps/advanced/console/migrations/.gitkeep deleted file mode 100644 index 72e8ffc..0000000 --- a/apps/advanced/console/migrations/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/apps/advanced/console/migrations/m130524_201442_init.php b/apps/advanced/console/migrations/m130524_201442_init.php new file mode 100644 index 0000000..24a74c3 --- /dev/null +++ b/apps/advanced/console/migrations/m130524_201442_init.php @@ -0,0 +1,27 @@ +createTable('tbl_user', array( + 'id' => Schema::TYPE_PK, + 'username' => Schema::TYPE_STRING.' NOT NULL', + 'password_hash' => Schema::TYPE_STRING.' NOT NULL', + 'email' => Schema::TYPE_STRING.' NOT NULL', + 'role' => 'tinyint NOT NULL DEFAULT 10', + + 'status' => 'tinyint NOT NULL DEFAULT 10', + 'create_time' => Schema::TYPE_INTEGER.' NOT NULL', + 'update_time' => Schema::TYPE_INTEGER.' NOT NULL', + ), $tableOptions); + } + + public function down() + { + $this->dropTable('tbl_user'); + } +}