Closed w0rd-driven closed 1 year ago
TablePlus has limitations around backup and restore primarily because the database names are different (beatseek in prod vs beatseek_dev). If I would compile to production locally it wouldn't be a problem but I move quickly in ignorance.
What I do is truncate tables then choose Copy Rows As > INSERT Statement
to insert data for the artists
table and then albums
. The correct way to adjust the sequences is to use SELECT setval('artists_id_seq', (SELECT MAX(id) FROM artists));
and repeat for each table.
I'm looking to create a revolving demonstration at some point where it'd be useful to have ecto.dump
combined with data to return to a pristine state. That file will need both of these techniques.
Added a troubleshooting section to the readme to help future me
After some time off I went back to the deployed application to work through issues as I noticed things weren't working as I thought I left it.
I'm currently in the process of adding these to the README and will use this as a generic issue instead of one per each problem as I likely should do it.
create unique_index(:albums, [:artist_id, :name])
set which isn't the correct order according to documentation.AUTO_INCREMENT=<number>
part of the create table definition where I can see the value.SELECT last_value FROM albums_id_seq;
returns 3 notselect max(id) from albums;
or 366.