Skip to content

Delete table #2701

Answered by simolus3
Sandrichka22 asked this question in Q&A
Oct 31, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

I tried doing that, but the tests for migrating from 54 to 55 fail with the following:

The "actual" schema is the schema of your database, so this error means that drift expected the TableToDelete table to still exist om schema 55. This is likely because you haven't deleted the table's definition before exporting the new schema. The CREATE TABLE statements in drift files always represent the latest schema, so if you want to delete a table you should also delete it from your sources.

If I delete it, then I would also need to remove every reference of it inside the table_referencing_deleted_table.drift (import and foreign key)

That's intentional though - if the table no longer exists, o…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Sandrichka22
Comment options

@simolus3
Comment options

Answer selected by Sandrichka22
@Sandrichka22
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants