namespace Migrations

open SimpleMigrations

[<Migration(201910122243L, "Create IngredientCategories")>]
type CreateIngredientCategories() =
    inherit Migration()

    override __.Up() = base.Execute(@"CREATE TABLE IngredientCategories(
      id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
      nameFi VARCHAR NOT NULL,
      nameEn VARCHAR NOT NULL,
      parentId INTEGER REFERENCES IngredientCategories
    )")

    override __.Down() = base.Execute(@"DROP TABLE IngredientCategories")
