Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC Puller: Create primary key only if not exist #900

Open
chmnata opened this issue Mar 8, 2024 · 1 comment
Open

GCC Puller: Create primary key only if not exist #900

chmnata opened this issue Mar 8, 2024 · 1 comment
Assignees

Comments

@chmnata
Copy link
Collaborator

chmnata commented Mar 8, 2024

Ran into an error
ERROR: multiple primary keys for table "loop_detector" are not allowed

Not exactly sure why this wasn't an issue before....
And because there is no add constraint if exist, there are a couple of solutions:

  • drop primary key and create again (NO CANNOT DO, BECAUSE IT WILL MESS WITH OUR AUDIT TABLE STRUCTURE)
  • Look at information table and see if a primary key exist on the table
  • Edit the create table line to do something like
Create table if not exist (
column1 data_type, 
column2 data_type, 
constraint pk_mail_app_recipients primary key (column1)

Then it will only add a primary key constraint when a new table is created.

owner_sql = sql.SQL("ALTER TABLE IF EXISTS {schema_table} OWNER to gis_admins").format(schema_table = sql.Identifier(schema_name, temp_table_name))

@chmnata chmnata added the bug label Mar 8, 2024
@chmnata chmnata self-assigned this Mar 8, 2024
@MelinaGoula MelinaGoula linked a pull request Mar 27, 2024 that will close this issue
@gabrielwol gabrielwol added the gis label Jul 4, 2024
@gabrielwol
Copy link
Collaborator

@chmnata should this issue also be closed as not planned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants