diff --git a/modules/account/src/frontend/migrations/m150302_154115_account_user.php b/modules/account/src/frontend/migrations/m150302_154115_account_user.php index 93982daa3..93ac32983 100644 --- a/modules/account/src/frontend/migrations/m150302_154115_account_user.php +++ b/modules/account/src/frontend/migrations/m150302_154115_account_user.php @@ -16,6 +16,17 @@ public function safeUp() 'password_salt' => $this->string(255), 'auth_token' => $this->string(255), 'is_deleted' => $this->integer(11)->defaultValue(0), + 'gender' => $this->smallInteger(1)->defaultValue(0), + 'street' => $this->string(120), + 'zip' => $this->string(20), + 'city' => $this->string(80), + 'country' => $this->string(80), + 'company' => $this->string(80), + 'subscription_newsletter' => $this->boolean()->defaultValue(0), + 'subscription_medianews' => $this->boolean()->defaultValue(0), + 'verification_hash' => $this->string(80), + 'is_mail_verified' => $this->boolean()->defaultValue(0), + 'is_active' => $this->boolean()->defaultValue(0), ]); } diff --git a/modules/account/src/frontend/migrations/m151214_095728_add_more_user_data.php b/modules/account/src/frontend/migrations/m151214_095728_add_more_user_data.php deleted file mode 100644 index 86fc66d76..000000000 --- a/modules/account/src/frontend/migrations/m151214_095728_add_more_user_data.php +++ /dev/null @@ -1,37 +0,0 @@ -addColumn('account_user', 'gender', $this->smallInteger(1)->defaultValue(0)); // 0 = Mrs; 1 = Mr - $this->addColumn('account_user', 'street', $this->string(120)); - $this->addColumn('account_user', 'zip', $this->string(20)); - $this->addColumn('account_user', 'city', $this->string(80)); - $this->addColumn('account_user', 'country',$this->string(80)); - $this->addColumn('account_user', 'company', $this->string(80)); - $this->addColumn('account_user', 'subscription_newsletter', $this->boolean()->defaultValue(0)); - $this->addColumn('account_user', 'subscription_medianews', $this->boolean()->defaultValue(0)); - $this->addColumn('account_user', 'verification_hash', $this->string(80)); - $this->addColumn('account_user', 'is_mail_verified', $this->boolean()->defaultValue(0)); - $this->addColumn('account_user', 'is_active', $this->boolean()->defaultValue(0)); - } - - public function safeDown() - { - $this->dropColumn('account_user', 'gender'); - $this->dropColumn('account_user', 'street'); - $this->dropColumn('account_user', 'zip'); - $this->dropColumn('account_user', 'city'); - $this->dropColumn('account_user', 'country'); - $this->dropColumn('account_user', 'company'); - $this->dropColumn('account_user', 'subscription_newsletter'); - $this->dropColumn('account_user', 'subscription_medianews'); - $this->dropColumn('account_user', 'verification_hash'); - $this->dropColumn('account_user', 'is_mail_verified'); - $this->dropColumn('account_user', 'is_active'); - } -} diff --git a/modules/crawler/src/admin/migrations/m150727_104346_crawler_index.php b/modules/crawler/src/admin/migrations/m150727_104346_crawler_index.php index e05b03aaf..8d1ebcd82 100644 --- a/modules/crawler/src/admin/migrations/m150727_104346_crawler_index.php +++ b/modules/crawler/src/admin/migrations/m150727_104346_crawler_index.php @@ -4,37 +4,24 @@ class m150727_104346_crawler_index extends Migration { - public function up() + public function safeUp() { $this->createTable('crawler_index', [ - 'id' => 'pk', - 'url' => 'varchar(200) NOT NULL', - 'content' => 'TEXT', - 'title' => 'varchar(200)', - 'added_to_index' => 'int(11)', - 'last_update' => 'int(11)', - 'arguments_json' => 'text NOT NULL', - 'language_info' => 'varchar(80)', + 'id' => $this->primaryKey(), + 'url' => $this->string(200)->notNull()->unique(), + 'title' => $this->string(200), + 'content' => $this->text(), + 'description' => $this->text(), + 'language_info' => $this->string(80), + 'url_found_on_page' => $this->string(255), + 'group' => $this->string(120), + 'added_to_index' => $this->integer(11)->defaultValue(0), + 'last_update' => $this->integer(11)->defaultValue(0), ]); - - $this->createIndex('uniqueurl', 'crawler_index', 'url', true); - } - - public function down() - { - echo "m150727_104346_crawler_index cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { } public function safeDown() { + $this->dropTable('crawler_index'); } - */ } diff --git a/modules/crawler/src/admin/migrations/m150727_105126_crawler_builder_index.php b/modules/crawler/src/admin/migrations/m150727_105126_crawler_builder_index.php index 1fed5a0f0..63f97961f 100644 --- a/modules/crawler/src/admin/migrations/m150727_105126_crawler_builder_index.php +++ b/modules/crawler/src/admin/migrations/m150727_105126_crawler_builder_index.php @@ -4,38 +4,27 @@ class m150727_105126_crawler_builder_index extends Migration { - public function up() + public function safeUp() { $this->createTable('crawler_builder_index', [ - 'id' => 'pk', - 'url' => 'varchar(200) NOT NULL', - 'content' => 'TEXT', - 'title' => 'varchar(200)', - 'last_indexed' => 'int(11)', - 'arguments_json' => 'text NOT NULL', // removed in beta3 - 'language_info' => 'varchar(80)', - 'crawled' => 'tinyint(1) default 0', - 'status_code' => 'tinyint(4) default 0', + 'id' => $this->primaryKey(), + 'url' => $this->string(200)->notNull()->unique(), + 'title' => $this->string(200), + 'content' => $this->text(), + 'description' => $this->text(), + 'language_info' => $this->string(80), + 'url_found_on_page' => $this->string(255), + 'group' => $this->string(120), + 'last_indexed' => $this->integer(11), + 'crawled' => $this->boolean()->defaultValue(0), + 'status_code' => $this->smallInteger(4)->defaultValue(0), + 'content_hash' => $this->string(80), + 'is_dublication' => $this->boolean()->defaultValue(0), ]); - - $this->createIndex('uniqueurl', 'crawler_builder_index', 'url', true); - } - - public function down() - { - echo "m150727_105126_crawler_builder_index cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { } public function safeDown() { + $this->dropTable('crawler_builder_index'); } - */ } diff --git a/modules/crawler/src/admin/migrations/m151213_201944_add_md5_sum.php b/modules/crawler/src/admin/migrations/m151213_201944_add_md5_sum.php deleted file mode 100644 index 899b43657..000000000 --- a/modules/crawler/src/admin/migrations/m151213_201944_add_md5_sum.php +++ /dev/null @@ -1,33 +0,0 @@ -addColumn("crawler_builder_index", "content_hash", "varchar(80)"); - $this->addColumn("crawler_builder_index", "is_dublication", "tinyint(1) default 0"); - $this->dropColumn("crawler_builder_index", "arguments_json"); - $this->dropColumn("crawler_index", "arguments_json"); - } - - public function down() - { - echo "m151213_201944_add_md5_sum cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - - public function safeDown() - { - } - */ -} diff --git a/modules/crawler/src/admin/migrations/m160420_093031_addreflink.php b/modules/crawler/src/admin/migrations/m160420_093031_addreflink.php deleted file mode 100644 index 0a134c4a8..000000000 --- a/modules/crawler/src/admin/migrations/m160420_093031_addreflink.php +++ /dev/null @@ -1,20 +0,0 @@ -addColumn('crawler_index', 'url_found_on_page', 'varchar(255)'); - $this->addColumn('crawler_builder_index', 'url_found_on_page', 'varchar(255)'); - } - - public function safeDown() - { - $this->dropColumn('crawler_index', 'url_found_on_page'); - $this->dropColumn('crawler_builder_index', 'url_found_on_page'); - } -} diff --git a/modules/crawler/src/admin/migrations/m160524_134433_searchindex.php b/modules/crawler/src/admin/migrations/m160524_134433_searchindex.php index 6b6615817..212d856df 100644 --- a/modules/crawler/src/admin/migrations/m160524_134433_searchindex.php +++ b/modules/crawler/src/admin/migrations/m160524_134433_searchindex.php @@ -4,7 +4,6 @@ class m160524_134433_searchindex extends Migration { - // Use safeUp/safeDown to run migration code within a transaction public function safeUp() { $this->createTable('crawler_searchdata', [ diff --git a/modules/crawler/src/admin/migrations/m160929_082726_add_section_field.php b/modules/crawler/src/admin/migrations/m160929_082726_add_section_field.php deleted file mode 100644 index 6b98424aa..000000000 --- a/modules/crawler/src/admin/migrations/m160929_082726_add_section_field.php +++ /dev/null @@ -1,19 +0,0 @@ -addColumn('crawler_index', 'group', 'varchar(120)'); - $this->addColumn('crawler_builder_index', 'group', 'varchar(120)'); - } - - public function safeDown() - { - $this->dropColumn('crawler_index', 'group'); - $this->dropColumn('crawler_builder_index', 'group'); - } -} diff --git a/modules/crawler/src/admin/migrations/m161024_134505_add_description_field.php b/modules/crawler/src/admin/migrations/m161024_134505_add_description_field.php deleted file mode 100644 index ac6bc9001..000000000 --- a/modules/crawler/src/admin/migrations/m161024_134505_add_description_field.php +++ /dev/null @@ -1,19 +0,0 @@ -addColumn('crawler_index', 'description', 'text'); - $this->addColumn('crawler_builder_index', 'description', 'text'); - } - - public function safeDown() - { - $this->dropColumn('crawler_index', 'description'); - $this->dropColumn('crawler_builder_index', 'description'); - } -} diff --git a/modules/errorapi/src/migrations/m150210_102242_error_data.php b/modules/errorapi/src/migrations/m150210_102242_error_data.php index 5eaa1f5a7..d9d88015d 100644 --- a/modules/errorapi/src/migrations/m150210_102242_error_data.php +++ b/modules/errorapi/src/migrations/m150210_102242_error_data.php @@ -5,20 +5,18 @@ class m150210_102242_error_data extends Migration { - public function up() + public function safeUp() { $this->createTable('error_data', [ - 'id' => 'pk', - 'identifier' => Schema::TYPE_STRING, - 'error_json' => Schema::TYPE_TEXT, - 'timestamp_create' => Schema::TYPE_INTEGER, + 'id' => $this->primaryKey(), + 'identifier' => $this->string(255), + 'error_json' => $this->text(), + 'timestamp_create' => $this->integer(11)->defaultValue(0), ]); } - public function down() + public function safeDown() { - echo "m150210_102242_error_data cannot be reverted.\n"; - - return false; + $this->dropTable('error_data'); } } diff --git a/modules/gallery/src/admin/migrations/m150504_094950_gallery_album.php b/modules/gallery/src/admin/migrations/m150504_094950_gallery_album.php index 4859b6924..9bace7601 100644 --- a/modules/gallery/src/admin/migrations/m150504_094950_gallery_album.php +++ b/modules/gallery/src/admin/migrations/m150504_094950_gallery_album.php @@ -4,34 +4,23 @@ class m150504_094950_gallery_album extends Migration { - public function up() + public function safeUp() { $this->createTable('gallery_album', [ - 'id' => 'pk', - 'cat_id' => 'int(11) NOT NULL default 0', - 'title' => 'varchar(150) NOT NULL', - 'description' => 'text', - 'cover_image_id' => 'int(11) default 0', - 'timestamp_create' => 'int(11) NOT NULL default 0', - 'timestamp_update' => 'int(11) NOT NULL default 0', + 'id' => $this->primaryKey(), + 'cat_id' => $this->integer()->defaultValue(0), + 'title' => $this->text()->notNull(), + 'description' => $this->text(), + 'cover_image_id' => $this->integer(11)->defaultValue(0), + 'timestamp_create' => $this->integer(0)->defaultValue(0), + 'timestamp_update' => $this->integer(0)->defaultValue(0), + 'is_highlight' => $this->boolean()->defaultValue(0), + 'sort_index' => $this->integer()->defaultValue(0), ]); } - public function down() - { - echo "m150504_094950_gallery_album cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - public function safeDown() { + $this->dropTable('gallery_album'); } - */ } diff --git a/modules/gallery/src/admin/migrations/m150504_132138_gallery_album_image.php b/modules/gallery/src/admin/migrations/m150504_132138_gallery_album_image.php index 6cd1063c5..4ae40f81e 100644 --- a/modules/gallery/src/admin/migrations/m150504_132138_gallery_album_image.php +++ b/modules/gallery/src/admin/migrations/m150504_132138_gallery_album_image.php @@ -4,29 +4,16 @@ class m150504_132138_gallery_album_image extends Migration { - public function up() + public function safeUp() { $this->createTable('gallery_album_image', [ - 'image_id' => 'int(11) NOT NULL default 0', - 'album_id' => 'int(11) NOT NULL default 0', + 'image_id' => $this->integer(11)->notNull(), + 'album_id' => $this->integer(11)->notNull(), ]); } - public function down() - { - echo "m150504_132138_gallery_album_image cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - public function safeDown() { + $this->dropTable('gallery_album_image'); } - */ } diff --git a/modules/gallery/src/admin/migrations/m150601_105400_gallery_cat.php b/modules/gallery/src/admin/migrations/m150601_105400_gallery_cat.php index c97ac14da..466dd461a 100644 --- a/modules/gallery/src/admin/migrations/m150601_105400_gallery_cat.php +++ b/modules/gallery/src/admin/migrations/m150601_105400_gallery_cat.php @@ -4,31 +4,18 @@ class m150601_105400_gallery_cat extends Migration { - public function up() + public function safeUp() { $this->createTable('gallery_cat', [ - 'id' => 'pk', - 'title' => 'VARCHAR(120) NOT NULL', - 'cover_image_id' => 'int(11) NOT NULL default 0', - 'description' => 'text', + 'id' => $this->primaryKey(), + 'title' => $this->text()->notNull(), + 'cover_image_id' => $this->integer(11)->defaultValue(0), + 'description' => $this->text(), ]); } - public function down() - { - echo "m150601_105400_gallery_cat cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - public function safeDown() { + $this->dropTable('gallery_cat'); } - */ } diff --git a/modules/gallery/src/admin/migrations/m160603_080705_album_add_sortindex_highlight.php b/modules/gallery/src/admin/migrations/m160603_080705_album_add_sortindex_highlight.php deleted file mode 100644 index 027c1a76c..000000000 --- a/modules/gallery/src/admin/migrations/m160603_080705_album_add_sortindex_highlight.php +++ /dev/null @@ -1,18 +0,0 @@ -addColumn('gallery_album', 'is_highlight', 'tinyint(1) NOT NULL default 0'); - $this->addColumn('gallery_album', 'sort_index', 'int(11) NOT NULL DEFAULT 0'); - } - - public function safeDown() - { - $this->dropColumn('gallery_album', 'is_highlight'); - $this->dropColumn('gallery_album', 'sort_index'); - } -} diff --git a/modules/news/src/admin/migrations/m150204_144806_news_article.php b/modules/news/src/admin/migrations/m150204_144806_news_article.php index 47963f983..7ecdebe5a 100644 --- a/modules/news/src/admin/migrations/m150204_144806_news_article.php +++ b/modules/news/src/admin/migrations/m150204_144806_news_article.php @@ -1,35 +1,32 @@ createTable('news_article', [ - 'id' => 'pk', - 'title' => Schema::TYPE_TEXT, - 'text' => Schema::TYPE_TEXT, - 'cat_id' => 'int(11) NOT NULL default 0', - 'image_id' => Schema::TYPE_INTEGER, - 'image_list' => Schema::TYPE_TEXT, - 'file_list' => Schema::TYPE_TEXT, - 'create_user_id' => Schema::TYPE_INTEGER, - 'update_user_id' => Schema::TYPE_INTEGER, - 'timestamp_create' => Schema::TYPE_INTEGER, - 'timestamp_update' => Schema::TYPE_INTEGER, - 'timestamp_display_from' => Schema::TYPE_INTEGER, - 'timestamp_display_until' => Schema::TYPE_INTEGER, - 'is_deleted' => 'tinyint(1) NOT NULL DEFAULT 0', - 'is_display_limit' => 'tinyint(1) NOT NULL DEFAULT 0', + 'id' => $this->primaryKey(), + 'title' => $this->text(), + 'text' => $this->text(), + 'cat_id' => $this->integer(11)->defaultValue(0), + 'image_id' => $this->integer(11)->defaultValue(0), + 'image_list' => $this->text(), + 'file_list' => $this->text(), + 'create_user_id' => $this->integer(11)->defaultValue(0), + 'update_user_id' => $this->integer(11)->defaultValue(0), + 'timestamp_create' => $this->integer(11)->defaultValue(0), + 'timestamp_update' => $this->integer(11)->defaultValue(0), + 'timestamp_display_from' => $this->integer(11)->defaultValue(0), + 'timestamp_display_until' => $this->integer(11)->defaultValue(0), + 'is_deleted' => $this->boolean()->defaultValue(0), + 'is_display_limit' => $this->boolean()->defaultValue(0), ]); } - public function down() + public function safeDown() { - echo "m150204_144806_news_article cannot be reverted.\n"; - - return false; + $this->dropTable('news_article'); } -} +} \ No newline at end of file diff --git a/modules/news/src/admin/migrations/m150428_095829_news_cat.php b/modules/news/src/admin/migrations/m150428_095829_news_cat.php index e33e98ca5..bad63e95a 100644 --- a/modules/news/src/admin/migrations/m150428_095829_news_cat.php +++ b/modules/news/src/admin/migrations/m150428_095829_news_cat.php @@ -7,8 +7,8 @@ class m150428_095829_news_cat extends Migration public function safeUp() { $this->createTable('news_cat', [ - 'id' => 'pk', - 'title' => 'VARCHAR(150) NOT NULL', + 'id' => $this->primaryKey(), + 'title' => $this->string(150)->notNull(), ]); } diff --git a/modules/news/src/admin/migrations/m161212_084323_add_teaser_field.php b/modules/news/src/admin/migrations/m161212_084323_add_teaser_field.php index 89b4d0a90..692de6841 100644 --- a/modules/news/src/admin/migrations/m161212_084323_add_teaser_field.php +++ b/modules/news/src/admin/migrations/m161212_084323_add_teaser_field.php @@ -4,10 +4,9 @@ class m161212_084323_add_teaser_field extends Migration { - // Use safeUp/safeDown to run migration code within a transaction public function safeUp() { - $this->addColumn('news_article', 'teaser_text', 'text'); + $this->addColumn('news_article', 'teaser_text', $this->text()); } public function safeDown() diff --git a/modules/remoteadmin/src/migrations/m150722_125833_remote_site.php b/modules/remoteadmin/src/migrations/m150722_125833_remote_site.php index b7605b5ba..a903d6751 100755 --- a/modules/remoteadmin/src/migrations/m150722_125833_remote_site.php +++ b/modules/remoteadmin/src/migrations/m150722_125833_remote_site.php @@ -1,35 +1,23 @@ createTable('remote_site', [ - 'id' => 'pk', - 'token' => 'varchar(120)', - 'url' => 'varchar(120)', - 'status' => 'int(11)', + 'id' => $this->primaryKey(), + 'token' => $this->string(120)->notNull(), + 'url' => $this->string(120)->notNull(), + 'auth_is_enabled' => $this->boolean()->defaultValue(0), + 'auth_user' => $this->string(120), + 'auth_pass' => $this->string(120), ]); } - public function down() - { - echo "m150722_125833_remote_site cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - public function safeDown() { + $this->dropTable('remote_site'); } - */ } diff --git a/modules/remoteadmin/src/migrations/m151013_084408_add_http_auth.php b/modules/remoteadmin/src/migrations/m151013_084408_add_http_auth.php deleted file mode 100644 index dea335c79..000000000 --- a/modules/remoteadmin/src/migrations/m151013_084408_add_http_auth.php +++ /dev/null @@ -1,32 +0,0 @@ -addColumn('remote_site', 'auth_is_enabled', 'TINYINT(1) DEFAULT 0'); - $this->addColumn('remote_site', 'auth_user', 'VARCHAR(120)'); - $this->addColumn('remote_site', 'auth_pass', 'VARCHAR(120)'); - } - - public function down() - { - echo "m151013_084408_add_http_auth cannot be reverted.\n"; - - return false; - } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - - public function safeDown() - { - } - */ -}