Skip to content

Commit

Permalink
reduce migration files due to version 1.0.0 release and used schema
Browse files Browse the repository at this point in the history
builder to support other dbms schemas #1108
  • Loading branch information
nadar committed Dec 19, 2016
1 parent 78f5304 commit b12073f
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 343 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
*/
}

This file was deleted.

20 changes: 0 additions & 20 deletions modules/crawler/src/admin/migrations/m160420_093031_addreflink.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down

This file was deleted.

This file was deleted.

16 changes: 7 additions & 9 deletions modules/errorapi/src/migrations/m150210_102242_error_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
*/
}
Loading

0 comments on commit b12073f

Please sign in to comment.