Commit 7dead511 by Vladislav

fix migration

1 parent 09b535b6
...@@ -26,7 +26,6 @@ class CreateGoalAdGroupsTable extends Migration ...@@ -26,7 +26,6 @@ class CreateGoalAdGroupsTable extends Migration
$table->timestamp('updated_need')->nullable(); $table->timestamp('updated_need')->nullable();
$table->timestamp('updated_self')->nullable(); $table->timestamp('updated_self')->nullable();
$table->timestamps(); $table->timestamps();
$table->timestamps();
$table->foreign('dictionary_campaign_id')->references('id')->on('dictionary_campaigns') $table->foreign('dictionary_campaign_id')->references('id')->on('dictionary_campaigns')
......
...@@ -14,6 +14,22 @@ class CreateKeywordsTable extends Migration ...@@ -14,6 +14,22 @@ class CreateKeywordsTable extends Migration
*/ */
public function up() public function up()
{ {
if (Schema::hasTable('goal_ad_groups') && Schema::hasColumn('goal_ad_groups', 'campaign_external_id')) {
Schema::create('goal_ad_groups', function (Blueprint $table) {
$table->renameColumn('campaign_external_id', 'dictionary_campaign_external_id');
});
}
if (Schema::hasTable('ad_groups') && !Schema::hasColumn('ad_groups', 'keywords_loaded_at')) {
Schema::create('ad_groups', function (Blueprint $table) {
$table->timestamp('keywords_loaded_at')->nullable();
});
}
Schema::create('keywords', function (Blueprint $table) { Schema::create('keywords', function (Blueprint $table) {
$table->id(); $table->id();
$table->bigInteger('external_id'); $table->bigInteger('external_id');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!