Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
ec5a8378
Commit
ec5a8378
authored
Nov 08, 2018
by
Okhin
Browse files
Fixing the migration with Foreign Key instead of an Index
parent
e87549e1
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
db/migrations/20181108145741_une_seule_adresse.php
View file @
ec5a8378
...
...
@@ -41,7 +41,7 @@ class UneSeuleAdresse extends AbstractMigration
$this
->
execute
(
'TRUNCATE TABLE adresses;'
);
// Add a unique index on user_id
$table
->
add
Index
([
'user_id'
]
,
[
'u
nique'
=>
true
]
)
$table
->
add
ForeignKey
(
'user_id'
,
'u
sers'
,
'id'
,
[
'delete'
=>
'CASCADE'
}
)
->
removeColumn
(
'alias'
)
->
save
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment