stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.63k stars 225 forks source link

Create table without PRIMARY KEY #109

Closed IevgeniiB closed 8 years ago

IevgeniiB commented 8 years ago

Hello!

I'm trying to use mosql, but always run into this issue: I have such config file:

test:
    restaurants:
        :columns:
            - name: TEXT
            - restaurant_id: TEXT
        :meta:
            :table: restaurants
            :extra_props: true

I have no primary key here. But mosql generates such query for table creation:

CREATE TABLE "restaurants" ("name" TEXT, "restaurant_id" TEXT, "_extra_props" TEXT, PRIMARY KEY (NULL))

Seems that PRIMARY KEY (NULL) has no sense. Maybe I'm doing something wrong? Is there some way to specify primary key if needed?

IevgeniiB commented 8 years ago

If someone will experience such issue - don't forget to import _id field as well