question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not dropping with {drop: true} due to relationships of tables

See original GitHub issue

It’s failing to drop the tables on rerun of the server due to dependencies within table relations (I assume). Thus, I am manually dropping the schema.

error: Uncaught (in promise) PostgresError: cannot drop table applications because other objects depend on it
  return new PostgresError(errorFields);
         ^
    at parseError (error.ts:106:10)
    at Connection._processError (connection.ts:434:19)
    at Connection._simpleQuery (connection.ts:298:20)
    at async Connection.query (connection.ts:546:16)
    at async Client.query (client.ts:25:12)
    at async PostgresConnector.query (postgres-connector.ts:60:22)
    at async Database.query (database.ts:164:21)
    at async Function.drop (model.ts:137:5)
    at async Database.sync (database.ts:129:9)
    at async app.ts:15:1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
rluvatoncommented, Jan 6, 2021

@saydus it should be fixed now, please try again (don’t forget the --reload flag)

1reaction
sayduscommented, Jan 5, 2021

Yes! @rluvaton, I just tested it and it seems to work now. The drop table issue still persists though:

error: Uncaught (in promise) PostgresError: cannot drop table applications because other objects depend on it
  return new PostgresError(errorFields);
         ^
    at parseError (error.ts:106:10)
    at Connection._processError (connection.ts:434:19)
    at Connection._simpleQuery (connection.ts:298:20)
    at async Connection.query (connection.ts:546:16)
    at async Client.query (client.ts:25:12)
    at async PostgresConnector.query (postgres-connector.ts:63:22)
    at async Database.query (database.ts:236:21)
    at async Function.drop (model.ts:137:5)
    at async Database.sync (
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeOrm cascade: true doesn't remove it's relations from other ...
Based on my research cascade: true should delete all records from capabilities table if it references to capability_trees table after I delete ......
Read more >
SQL DROP TABLE statement overview
This article explores SQL DROP TABLE statement for dropping SQL Server table along with various use cases.
Read more >
Db2 11 - Db2 SQL - DROP - IBM
Whenever an object is dropped, its description is deleted from the catalog at the current server, and any packages that refer to the...
Read more >
Create, edit or delete a relationship - Microsoft Support
The Edit Relationships dialog box appears. Select the Enforce Referential Integrity check box. Select either the Cascade Update Related Fields or the Cascade...
Read more >
TRUNCATE TABLE vs. DELETE vs. DROP TABLE: Removing ...
What's the difference between truncating, deleting, and dropping a table in SQL? Find out in this article. There are a lot of ways...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found