Can I change the primary key in my Destination table?
Yes, you can change the primary key (PK) in your Destination table after creating the Pipeline. For this, you need to remove the existing PK and create a new one. The primary key is a unique value that identifies a row in a table. Therefore, if Hevo finds duplicate primary key values, an error is displayed in the Destination Workbench.
Perform the following steps:
-
Click Destinations in the Navigation Bar and select the Destination for which you wish to change the primary key.
-
In the left navigation pane, click Workbench.
-
In the SQL QUERY editor:
-
Enter the following command to remove the existing primary key:
ALTER TABLE <table_name> DROP CONSTRAINT <constraint_name>;
Note: Replace the placeholder values in the command above with your own.
-
Click RUN QUERY.
-
Enter the following command to add create the new primary key:
ALTER TABLE <table_name> ADD CONSTRAINT <constraint_name> PRIMARY KEY (<column_name>);
Note: Replace the placeholder values in the command above with your own.
-
Click RUN QUERY.
-
Click Refresh Icon () to update the primary key for the table.
-