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

Add primary key to create table query in postgres dialect #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kimxogus
Copy link

I'm trying to use slick-migration-api with cockroachdb.

As cockroachdb doesn't support updating pk, primary keys must be in create table query.

Therefore I added primary key declaration in create table query postgres dialect.

@kimxogus kimxogus changed the title Primary key in create table Add primary key to create table query in postgres dialect Oct 13, 2019
@nafg nafg force-pushed the master branch 7 times, most recently from 24176d9 to 4373aa5 Compare July 12, 2022 06:31
@nafg nafg force-pushed the primary-key-in-create-table branch from 7d2f808 to d0f31ad Compare July 12, 2022 06:38
xs.foldLeft((List.empty[B], List.empty[A])) {
case ((bs, as), a) =>
toB.andThen(b => (b :: bs, as)).applyOrElse(a, (_: A) => (bs, a :: as))
private def partition(xs: List[TableMigration.Action]): (List[AddColumn], List[AddPrimaryKey], List[TableMigration.Action]) =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you have to change partition?

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

Successfully merging this pull request may close these issues.

2 participants