Oracle Schema
schema
The schema
block describes a database schema.
schema "public" {
...
}
schema
attributes
Name | Required | Value |
---|---|---|
name | false | string |
schema
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., schema "name" ) | true |
table
The table
block describes a table in a database schema.
table "users" {
schema = schema.public
column "id" {
type = int
}
...
}
table
attributes
Name | Required | Value |
---|---|---|
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
table
blocks
table.check
table.check
attributes
Name | Required | Value |
---|---|---|
expr | true | string |
table.check
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
table.column
table.column
attributes
Name | Required | Value |
---|---|---|
as | false | string |
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
table.column
blocks
table.column.identity
table.column.identity
attributes
Name | Required | Value |
---|---|---|
cache | false | int |
cycle | false | bool |
generated | false |
|
increment | false | int |
max_value | false | int |
min_value | false | int |
order | false | bool |
start | false | int |
table.column
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., table.column "name" ) | true |
Mutually exclusive sets | [as (attribute), as (block)] |
table.foreign_key
table.foreign_key
attributes
Name | Required | Value |
---|---|---|
columns | true | Foreign key columns can be one of:
|
on_delete | false |
|
ref_columns | true | Foreign key reference columns can be one of:
|
table.foreign_key
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., table.foreign_key "name" ) | true |
table.index
table.index
attributes
Name | Required | Value |
---|---|---|
bitmap | false | bool |
columns | false | Index columns can be one of:
|
reversed | false | bool |
unique | false | bool |