From f14c090e5f932df078cd0047062d683ee428a6b5 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 31 Oct 2016 18:51:20 +0200 Subject: [PATCH] -Blog migrations started --- backend/config/test-local.php | 9 +++++++++ common/config/test-local.php | 13 +++++++++++++ console/migrations/m161031_160156_blog.php | 43 +++++++++++++++++++++++++++++++++++++++++++ frontend/config/test-local.php | 9 +++++++++ 4 files changed, 74 insertions(+), 0 deletions(-) create mode 100644 backend/config/test-local.php create mode 100644 common/config/test-local.php create mode 100644 console/migrations/m161031_160156_blog.php create mode 100644 frontend/config/test-local.php diff --git a/backend/config/test-local.php b/backend/config/test-local.php new file mode 100644 index 0000000..4513a34 --- /dev/null +++ b/backend/config/test-local.php @@ -0,0 +1,9 @@ + [ + 'db' => [ + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test', + ] + ], + ] +); diff --git a/console/migrations/m161031_160156_blog.php b/console/migrations/m161031_160156_blog.php new file mode 100644 index 0000000..6a30e7e --- /dev/null +++ b/console/migrations/m161031_160156_blog.php @@ -0,0 +1,43 @@ +createTable( + 'blog_article', + [ + 'id' => $this->primaryKey(), + 'image' => $this->string(255), + 'created_at' => $this->integer(), + 'updated_at' => $this->integer(), + 'deleted_at' => $this->integer(), + 'sort' => $this->integer(), + 'status' => $this->boolean(), + 'author_id' => $this->integer(), + ] + ); + + $this->createTable( + 'blog_article_lang', + [ + 'title' => $this->string(255), + 'body' => $this->text(), + 'body_preview' => $this->text(), + 'alias' => $this->string(255), + 'meta_title' => $this->string(255), + 'meta_description' => $this->string(255), + 'h1' => $this->string(255), + 'seo_text' => $this->string(255), + ] + ); + } + + public function down() + { + + } + } diff --git a/frontend/config/test-local.php b/frontend/config/test-local.php new file mode 100644 index 0000000..4513a34 --- /dev/null +++ b/frontend/config/test-local.php @@ -0,0 +1,9 @@ +