Skip to content
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

Add Foreign Key Constraint with tests #8

Open
3 tasks done
marcotas opened this issue Jun 21, 2022 · 0 comments
Open
3 tasks done

Add Foreign Key Constraint with tests #8

marcotas opened this issue Jun 21, 2022 · 0 comments
Assignees
Milestone

Comments

@marcotas
Copy link
Contributor

marcotas commented Jun 21, 2022

  • Create

In Column

table.bigInteger('user_id')
    .references('id')
    .on('users')
    .onDelete('cascade')
    .onUpdate('set null');

In Table

table.foreign('user_id')
    .references('id')...
  • Update

In Column

table.bigInteger('user_id')
    .references('id')
    .on('users')
    .onDelete('cascade')
    .onUpdate('set null')
    .change();

In Table

table.foreign(...)...
  • Delete
table.dropForeign(columns: ['user_id']);
table.dropForeign(names: ['test_user_id_fk']);
@marcotas marcotas self-assigned this Jun 21, 2022
@marcotas marcotas moved this from 🔖 To Do to 🏗 In progress in Tunder Jun 23, 2022
@marcotas marcotas moved this from 🏗 In progress to 📖 To Doc in Tunder Jun 23, 2022
@marcotas marcotas added this to the v1.0.0 milestone Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📖 Documenting
Development

No branches or pull requests

1 participant