-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atlas schema apply
: complains that auto-generated dev schema does not exist
#1711
Comments
@a8m sniffed this: |
I upgraded to this git revision to catch some fixes: My latest config is:
variable "POSTGRES_DB" {
type = string
default = getenv("POSTGRES_DB")
}
variable "POSTGRES_USER" {
type = string
default = getenv("POSTGRES_USER")
}
variable "POSTGRES_PASSWORD" {
type = string
default = getenv("POSTGRES_PASSWORD")
}
variable "POSTGRES_SCHEMA" {
type = string
default = "beehive"
}
variable "POSTGRES_SSL_MODE" {
type = string
default = getenv("POSTGRES_SSL_MODE") != "" ? getenv("POSTGRES_SSL_MODE") : "disable"
}
env {
// This is required, and is taken from the --env flag passed to the CLI. In an an unlabelled block like this its only
// used in the Atlas UI to show deployments.
name = atlas.env
// Declare where the schema definition resides.
// Also supported:
// src = "./dir/with/schema"
// src = ["multi.hcl", "file.hcl"]
# src = "./schema.sql"
src = "./schema.hcl"
// Define the URL of the database which is managed in
// this environment.
url = "postgres://${var.POSTGRES_USER}:${var.POSTGRES_PASSWORD}@0.0.0.0:5432/${var.POSTGRES_DB}?sslmode=${var.POSTGRES_SSL_MODE}"
// Define the URL of the Dev Database for this environment
// See: https://atlasgo.io/concepts/dev-database
dev = "docker://postgres/15/dev"
migration {
// URL where the migration directory resides. Only filesystem directories
// are currently supported but more options will be added in the future.
dir = "file://migrations"
// An optional format of the migration directory:
// atlas (default) | flyway | liquibase | goose | golang-migrate | dbmate
format = atlas
}
}
schema "beehive" {
}
table "Extraction" {
schema = schema.beehive
column "extractionId" {
null = false
type = text
}
column "chainId" {
null = false
type = integer
}
column "lastBlockNumber" {
null = false
type = integer
}
column "outputsHash" {
null = false
type = text
}
primary_key {
columns = [column.extractionId]
}
}
table "Queue" {
schema = schema.beehive
column "slotId" {
null = false
type = integer
default = sql("nextval('beehive.\"Queue_slotId_seq\"'::regclass)")
}
column "status" {
null = false
type = enum.QueueStatus
default = "ACCEPTED"
}
column "request" {
null = false
type = jsonb
}
column "result" {
null = true
type = jsonb
}
column "error" {
null = true
type = text
}
column "enqueueTime" {
null = false
type = timestamp(3)
default = sql("CURRENT_TIMESTAMP")
}
column "updateTime" {
null = false
type = timestamp(3)
default = sql("CURRENT_TIMESTAMP")
}
column "routingTag" {
null = false
type = text
}
column "requestId" {
null = false
type = text
}
primary_key {
columns = [column.slotId]
}
index "Queue_routingTag_requestId_key" {
unique = true
columns = [column.routingTag, column.requestId]
}
}
table "atlas_schema_revisions" {
schema = schema.beehive
column "version" {
null = false
type = character_varying
}
column "description" {
null = false
type = character_varying
}
column "type" {
null = false
type = bigint
default = 2
}
column "applied" {
null = false
type = bigint
default = 0
}
column "total" {
null = false
type = bigint
default = 0
}
column "executed_at" {
null = false
type = timestamptz
}
column "execution_time" {
null = false
type = bigint
}
column "error" {
null = true
type = text
}
column "error_stmt" {
null = true
type = text
}
column "hash" {
null = false
type = character_varying
}
column "partial_hashes" {
null = true
type = jsonb
}
column "operator_version" {
null = false
type = character_varying
}
primary_key {
columns = [column.version]
}
}
enum "QueueStatus" {
schema = schema.beehive
values = ["ACCEPTED", "EXECUTING", "COMPLETED", "ERRORED"]
}
Gives error:
My schema has If I create |
this is running with a DB with some other schemas in it. I get the same error with or without |
When running (on v0.12.0 / postgres):
I get the following error:
With atlas.hcl:
and schema.hcl:
The text was updated successfully, but these errors were encountered: