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.

Support setting unique columns on console

See original GitHub issue

If one would like to set up a table in postgresql such that two columns together must be unique it would have to do this in sql:

CREATE TABLE someTable (
    id serial primary key,
    col1 int NOT NULL,
    col2 int NOT NULL,
    unique (col1, col2)
)

So, col1 and col2 can repeat, but not at the same time. So, this would be allowed (Not including the id)

1 1
1 2
2 1
2 2

but not this:

1 1
1 2
1 1 -- would reject this insert for violating constraints

Work around

Create table in the sql console, untrack table then track it once created. Caveat : it is not exported in the metadata.json.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dsandipcommented, Jan 3, 2019

@Sach97 @revskill10 This is being handled in #506. Closing this one.

1reaction
revskill10commented, Nov 21, 2018

I think the need is real and Console UI should support this out of the box, though using SQL is not a big deal. Nice to have feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Columns marked as Unique in Hub Console allow duplicates
Hub creates Unique constraint and non-unique index for the unique enabled column. The new column is added after the table was loaded with...
Read more >
console.table() - Web APIs | MDN
The console.table() method displays tabular data as a table. ... The first column in the table will be labeled (index) .
Read more >
support composite primary, and foreign keys and unique ...
As of now: You can set composite primary keys from the console while creating the table You cannot set ... Support setting unique...
Read more >
Custom columns in Backup & Recovery Console - N-able
Adding custom columns · Log in to the Console under a SuperUser account · Click Columns > Add column · Assign a unique...
Read more >
Column names in each table must be unique ... - Stack Overflow
Column names in each table must be unique. Column name 'StripeRecipientId' in table 'dbo.Foos' is specified more than once. I double-checked and ...
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