Skip to content

Clarify differences between database backends, and clarify third argument in create_table #806

@darltrash

Description

@darltrash

I have a moonscript file like the following:

import Model from require "lapis.db.model"
import create_table, types from require "lapis.db.schema"

create_table "invite_codes", {
    { "id", types.serial }

    "PRIMARY KEY (id)"
}

class InviteCodes extends Model
    @primary_key: "id"

return {
    :InviteCodes
}

and i get the following:

SQL: CREATE TABLE "invite_codes" (
  "id" nil,
  PRIMARY KEY (id)
)

now, I have two questions, is this normal? am I misusing this? and, isn't it meant to be CREATE TABLE "invite_codes" IF NOT EXISTS instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions