-
Notifications
You must be signed in to change notification settings - Fork 3
Update tou_version and tou_acceptances migration #1028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a3589f
e0f554c
a630e3a
3754c00
e103876
28de5d5
61a7904
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like it is renaming and modifying an existing database migration. Each change to the database schema requires its own migration. If you delete or modify an existing migration, you will likely break Laravel's migration tracking. In this case, I expect that:
This PR should contain a new migration file that makes the required changes to the existing I also recommend reading up on how Laravel's database migration process works. Laravel's docs on Database Migrations is probably a good place to start. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ | |
| */ | ||
| public function up(): void { | ||
| Schema::create('tou_versions', function (Blueprint $table) { | ||
| $table->id(); | ||
| $table->string('version')->unique(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, make the column a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember to make the |
||
| $table->boolean('active')->default(false); | ||
| $table->timestamps(); | ||
|
|
||
dati18 marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, each time the database schema is changed, a new migration is required. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,16 @@ public function up(): void { | |
| Schema::create('tou_acceptances', function (Blueprint $table) { | ||
| $table->id(); | ||
| $table->unsignedInteger('user_id'); | ||
| $table->string('tou_version', 10); | ||
| $table->string('tou_version'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come you've removed the As hinted at in #977 (review), I think we should use You'll probably have to do something like this to update the column's data type: |
||
| $table->timestamp('tou_accepted_at'); | ||
| $table->timestamps(); | ||
| $table->unique(['user_id', 'tou_version']); | ||
| $table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete(); | ||
| $table->foreign('tou_version') | ||
| ->references('version') | ||
| ->on('tou_versions') | ||
| ->cascadeOnUpdate() | ||
| ->restrictOnDelete(); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.