You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seeding currently does not work as expected for me.
My expectation would be that I can add data to the seed files and when I apply them on the remote they get re-executed (because their hash changes).
What actually happens, though, is that the hash gets updated but the file is ignored otherwise.
What is the purpose of this behaviour?
The issue is here:
If a seed file exists but its content (=hash) changed, it is marked as dirty here:
returnerrors.Errorf("failed to send batch: %w", err)
}
An example of my seed would be:
-- file_types has a primary key on "ext"INSERT INTO file_types (ext, description)
VALUES
('zip', 'some description'),
('tar', 'some other description')
ON CONFLICT DO UPDATESET description=EXCLUDED.description;
If that is my initial seed file, I can have it in git and update it as my app grows, e.g.:
-- file_types has a primary key on "ext"INSERT INTO file_types (ext, description)
VALUES
('zip', 'a better description'),
('tar', 'some other description'),
('xz', 'a much better description')
ON CONFLICT DO UPDATESET description=EXCLUDED.description;
Now one row will be updated, one ignored and one inserted.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Seeding currently does not work as expected for me.
My expectation would be that I can add data to the seed files and when I apply them on the remote they get re-executed (because their hash changes).
What actually happens, though, is that the hash gets updated but the file is ignored otherwise.
What is the purpose of this behaviour?
The issue is here:
If a seed file exists but its content (=hash) changed, it is marked as dirty here:
cli/pkg/migration/seed.go
Lines 52 to 59 in 0bfa100
However, if it is dirty, it seems its contents are not added to the batch of changes but only the hash is updated:
cli/pkg/migration/file.go
Lines 172 to 183 in 0bfa100
An example of my seed would be:
If that is my initial seed file, I can have it in git and update it as my app grows, e.g.:
Now one row will be updated, one ignored and one inserted.
The text was updated successfully, but these errors were encountered: