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

Migrations should not mention model #59

Closed
ScottRobbins opened this issue Aug 9, 2019 · 1 comment
Closed

Migrations should not mention model #59

ScottRobbins opened this issue Aug 9, 2019 · 1 comment
Labels
enhancement New feature or request
Projects

Comments

@ScottRobbins
Copy link
Sponsor

In the api template currently: https://github.com/vapor/api-template/blob/4/Sources/App/Migrations/CreateTodo.swift

It starts with the line Todo.schema(on: database)

I think that migrations should probably be completely separate from the fluent models. By referencing the fluent model here, it means if you ever rename the table, you'd probably want to rename the model. But doing that would mean that previous migrations that referenced the model would have to change, which is kind of weird doesn't accurately reflect how things were migrated throughout time.

@tanner0101 tanner0101 added the enhancement New feature or request label Aug 14, 2019
@tanner0101 tanner0101 added this to To Do in Vapor 4 via automation Aug 14, 2019
@tanner0101
Copy link
Member

tanner0101 commented Feb 18, 2020

Agreed, this is how things work now in latest Fluent 4 👍

Vapor 4 automation moved this from To Do to Done Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Vapor 4
  
Done
Development

No branches or pull requests

2 participants