postgresqlscalaplayframeworkplayframework-evolutions

Play Evolutions: getting a syntax error. What gives?


I'm trying to write an evolutions file, and keep getting a syntax error that simply baffles me. Below is the entire evolution.

The error message I'm getting is: syntax error at end of input Position: 32 [ERROR:0, SQLSTATE:42601]

Stack:

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

I can run both the ups script and the downs script manually just fine. I've tried dropping my database and running through all my evolutions from scratch, and keep getting this error.

What gives? I can't find anything wrong with my syntax.

# --- !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";

Screenshot:

enter image description here


Solution

  • 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.