Explains what the feature is or what its benefits are to the user or customer.
Use this procedure to remove a relationship between tables or define a new one. This operation works for both kinds of relationships: foreign key or generic relationship.
To change the relationship between tables:
- Take a snapshot.
- Connect to the database with the ThoughtSpot SQL Command Line (TQL).
Issue the command to drop the existing relationship, by issuing a command like
one of these examples:
- Drop a foreign key by name, if it was given a name when it was
TQL> ALTER TABLE "sales_fact" DROP CONSTRAINT "FK_PO_number";
- Drop a relationship by name, if it was given a name when it was
TQL> ALTER TABLE "fruit_dim" DROP RELATIONSHIP "REL_dates";
- Drop the foreign key relationship explicitly, if it doesn't have a name,
by referencing the two tables that are joined. This drops all foreign
keys between the two
TQL> ALTER TABLE "shipments" DROP CONSTRAINT FOREIGN KEY "orders";
- Drop all generic relationships between two
TQL> ALTER TABLE "wholesale_buys" DROP RELATIONSHIP WITH "retail_sales";
- Drop a foreign key by name, if it was given a name when it was defined:
- Define a new relationship, if you want to, using ALTER TABLE...ADD CONSTRAINT...
- Test that any dependent objects (pinboards, worksheets, etc.) are still working correctly.
Delete the snapshot you created earlier using the command:
tscli snapshot delete <name>