cloudfoundry-community / autosleep

Auto sleep service for CloudFoundry
Apache License 2.0
39 stars 21 forks source link

Syntax Error in CRATE TABLE Statement when deploying with PostgreSQL #290

Open JuergenSu opened 6 years ago

JuergenSu commented 6 years ago

Hello,

We want do deploy the autosleep service broker in our own CloudFoundry deployment. Unfortunatelly we do not have a mysql but only a postgesql 9.1. When we do so and startup the autowakeup-app it tries to create tables using liquibase. But this fails due to a SQL Syntax Error

Position: 135 [Failed SQL: CREATE TABLE public."SpaceEnrollerConfig" (id VARCHAR(255) NOT NULL, "excludeFromAutoEnrollment" BYTEA, "forcedAutoEnrollment" BOOLEAN(1) NOT NULL, "idleDuration" BYTEA, "organizationId" VARCHAR(255), "planId" VARCHAR(255), secret VARCHAR(255), "serviceDefinitionId" VARCHAR(255), "spaceId" VARCHAR(255), "ignoreRouteServiceError" BOOLEAN(1) DEFAULT FALSE NOT NULL, CONSTRAINT PK_SPACEENROLLERCONFIG PRIMARY KEY (id, "forcedAutoEnrollment"))] 

it seams to be somehow related to the BOOLEAN(1) notation. When Changing to BOOLEAN without the (1) it seems to work.

Could you please have a look at it.

kind regards Juergen Sussner

JuergenSu commented 6 years ago

HI, it seems to be fixed with the latest liquibase version.

with this the generated SQL is

CREATE TABLE "public"."SpaceEnrollerConfig" ("id" VARCHAR(255) NOT NULL, "excludeFromAutoEnrollment" OID, "forcedAutoEnrollment" BOOLEAN NOT NULL, "idleDuration" OID, "organizationId" VARCHAR(255), "planId" VARCHAR(255), "secret" VARCHAR(255), "serviceDefinitionId" VARCHAR(255), "spaceId" VARCHAR(255), "ignoreRouteServiceError" BOOLEAN DEFAULT FALSE NOT NULL, CONSTRAINT "PK_SPACEENROLLERCONFIG" PRIMARY KEY ("id", "forcedAutoEnrollment"));

Liquibase version: 3.5.4

gberche-orange commented 6 years ago

thanks @JuergenSu for your report. The SpaceEnrollerConfig is related to the org enrollement feature that @pradyutsarma is working on. A pr to bump liquibase version would be most welcomed.