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

Conflict between AutoMigration and Migration #114

Open
Goloso98 opened this issue Aug 24, 2024 · 0 comments
Open

Conflict between AutoMigration and Migration #114

Goloso98 opened this issue Aug 24, 2024 · 0 comments

Comments

@Goloso98
Copy link

Goloso98 commented Aug 24, 2024

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base: yes

Describe the bug
Using a fresh database, main runs starting database init which first will run AutoMigrate on all models, including Vehicle with VIN field already in it. After that proceeds to "normal" migration which will try to add VIN again and will error because AutoMigrate already did and because it errors wont sign that migration as done.

hammond  | 2024/08/24 17:27:12 /api/db/migrations.go:39 record not found
hammond  | [0.081ms] [rows:0] SELECT * FROM `migrations` WHERE name="2022_03_08_13_16_AddVIN" ORDER BY `migrations`.`id` LIMIT 1
hammond  | ALTER TABLE vehicles ADD COLUMN vin text
hammond  | 
hammond  | 2024/08/24 17:27:12 /api/db/migrations.go:42 duplicate column name: vin
hammond  | [0.015ms] [rows:0] ALTER TABLE vehicles ADD COLUMN vin text

To Reproduce
Steps to reproduce the behavior:

  1. New installation
  2. Fresh database
  3. Error on migrate

Expected behavior
On a fresh install it add all migrations as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant