1

我正在尝试编写一个演变文件,并且不断收到令我困惑的语法错误。下面是整个进化过程。

我收到的错误消息是:syntax error at end of input Position: 32 [ERROR:0, SQLSTATE:42601]

堆:

Play Framework 2.4
Postgresql 9.4
Slick 3.1.1
Scala 2.11
Play-Slick 1.1.1
Play-Slick Evolutions 1.1.1

我可以手动运行 ups 脚本和 downs 脚本就好了。我已经尝试删除我的数据库并从头开始运行我的所有演变,并不断收到此错误。

是什么赋予了?我找不到我的语法有什么问题。

# --- !Ups

ALTER TABLE "blockly_challenge"
  ADD COLUMN "diagram" CHAR(10) NOT NULL DEFAULT 'none',
  ADD COLUMN "success_diagram" CHAR(10),
  ADD COLUMN "robot_type" SMALLINT NOT NULL DEFAULT 1001,
  ADD COLUMN "icon" CHAR(10);

CREATE TABLE "blockly_challenge_coordinates" (
  "id" SERIAL,
  PRIMARY KEY (id),
  "x" SMALLINT NOT NULL,
  "y" SMALLINT NOT NULL,
  "challenge_uuid" CHAR(10) NOT NULL,
  "dependent_on_uuid" CHAR(10)[] NOT NULL DEFAULT '{}',
  "created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  "updated_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX "blockly_coordinates_challenge_uuid_idx" ON "blockly_challenge_coordinates" ("challenge_uuid");
CREATE INDEX "blockly_coordinates_challenge_depends_on_uuid_idx" ON "blockly_challenge_coordinates" ("dependent_on_uuid");


# --- !Downs

ALTER TABLE "blockly_challenge"
  DROP COLUMN IF EXISTS "diagram",
  DROP COLUMN IF EXISTS "success_diagram",
  DROP COLUMN IF EXISTS "robot_type",
  DROP COLUMN IF EXISTS "icon",
  DROP COLUMN IF EXISTS "dependent_on",
  DROP COLUMN IF EXISTS "coordinates_y",
  DROP COLUMN IF EXISTS "coordinates_x";

DROP INDEX IF EXISTS "blockly_coordinates_challenge_uuid_idx" CASCADE;

DROP INDEX IF EXISTS "blockly_coordinates_challenge_depends_on_uuid_idx" CASCADE;

DROP TABLE IF EXISTS "blockly_challenge_coordinates";

截屏:

enter image description here

4

1 回答 1

0

I figured this out. This file is my 2.sql, and I had started working on a 3.sql but deleted it in lieu of just refactoring my 2.sql. Seems like there's some compilation step that grabs my evolution files and generates something based off of it. Once I ran an sbt clean everything started working fine.

于 2016-11-01T22:06:40.017 回答