Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a table that I have imported from Excel into Postgres using

COPY table(...) FROM 'example.csv' WITH DELIMETER "," CSV HEADER

So this table doesn't have a Primary Key, I know how to add a Primary key column to an existing table in Postgres but my issue is this one: I have an NodeJS app that uses Sequelize to query it, where I defined a model (without defining a primary key).

1) Should I add the primary key column in Postgres, then modify Sequelize define to reflect that and then Sync() [will this keep my data?]

or is there a better way to do this? adding both a primary key to Postgres and to the Sequelize model without deleting the data? Thx

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.