Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 322960e

Browse files
authored
Added name, email and password in shops table migration if its missing from current shops table (#1209)
* fixed issue when using custom table for authentication instead of users table * fixed charges model saving when using custom shop table * refactor code for reusing shops table name and its foreign id * refactor getShopsTable() and added new method for getting shops table foreign key * Remove unwanted new line feom Charge model contractor * auto fixes code style from php-cs-fixer * added name, email and password in create shops table migration if its missing current shops table
1 parent 8967d29 commit 322960e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/resources/database/migrations/2020_01_29_230905_create_shops_table.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ public function up(): void
2424
$table->softDeletes();
2525
}
2626

27+
if (! Schema::hasColumn(Util::getShopsTable(), 'name')) {
28+
$table->string('name')->nullable();
29+
}
30+
31+
if (! Schema::hasColumn(Util::getShopsTable(), 'email')) {
32+
$table->string('email')->nullable();
33+
}
34+
35+
if (! Schema::hasColumn(Util::getShopsTable(), 'password')) {
36+
$table->string('password', 100)->nullable();
37+
}
38+
2739
$table->foreign('plan_id')->references('id')->on(Util::getShopifyConfig('table_names.plans', 'plans'));
2840
});
2941
}
@@ -38,6 +50,9 @@ public function down(): void
3850
Schema::table(Util::getShopsTable(), function (Blueprint $table) {
3951
$table->dropForeign(Util::getShopsTable().'_plan_id_foreign');
4052
$table->dropColumn([
53+
'name',
54+
'email',
55+
'password',
4156
'shopify_grandfathered',
4257
'shopify_namespace',
4358
'shopify_freemium',

0 commit comments

Comments
 (0)