// The file represents the schema of each of the config table

 enum_schema |         enum_name         |          enum_value
-------------+---------------------------+------------------------------
 public      | job_status                | pending
 public      | job_status                | running
 public      | job_status                | incomplete
 public      | job_status                | failed
 public      | job_status                | succeeded
 public      | job_status                | cancelled
 public      | attempt_status            | running
 public      | attempt_status            | failed
 public      | attempt_status            | succeeded
 public      | job_config_type           | check_connection_source
 public      | job_config_type           | check_connection_destination
 public      | job_config_type           | discover_schema
 public      | job_config_type           | get_spec
 public      | job_config_type           | sync
 public      | job_config_type           | reset_connection
 public      | source_type               | api
 public      | source_type               | file
 public      | source_type               | database
 public      | source_type               | custom
 public      | actor_type                | source
 public      | actor_type                | destination
 public      | operator_type             | normalization
 public      | operator_type             | dbt
 public      | namespace_definition_type | source
 public      | namespace_definition_type | destination
 public      | namespace_definition_type | customformat
 public      | status_type               | active
 public      | status_type               | inactive
 public      | status_type               | deprecated




                                    Table "public.workspace"
          Column           |           Type           | Collation | Nullable |      Default
---------------------------+--------------------------+-----------+----------+-------------------
 id                        | uuid                     |           | not null |
 customer_id               | uuid                     |           |          |
 name                      | character varying(256)   |           | not null |
 slug                      | character varying(256)   |           | not null |
 email                     | character varying(256)   |           |          |
 initial_setup_complete    | boolean                  |           | not null |
 anonymous_data_collection | boolean                  |           |          |
 send_newsletter           | boolean                  |           |          |
 send_security_updates     | boolean                  |           |          |
 display_setup_wizard      | boolean                  |           |          |
 tombstone                 | boolean                  |           | not null | false
 notifications             | jsonb                    |           |          |
 first_sync_complete       | boolean                  |           |          |
 feedback_complete         | boolean                  |           |          |
 created_at                | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at                | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "workspace_pkey" PRIMARY KEY, btree (id)
Referenced by:
    TABLE "actor" CONSTRAINT "actor_workspace_id_fkey" FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE
    TABLE "operation" CONSTRAINT "operation_workspace_id_fkey" FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE




                             Table "public.actor_definition"
      Column       |           Type           | Collation | Nullable |      Default
-------------------+--------------------------+-----------+----------+-------------------
 id                | uuid                     |           | not null |
 name              | character varying(256)   |           | not null |
 docker_repository | character varying(256)   |           | not null |
 docker_image_tag  | character varying(256)   |           | not null |
 documentation_url | character varying(256)   |           |          |
 icon              | character varying(256)   |           |          |
 actor_type        | actor_type               |           | not null |
 source_type       | source_type              |           |          |
 spec              | jsonb                    |           | not null |
 created_at        | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at        | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "actor_definition_pkey" PRIMARY KEY, btree (id)
Referenced by:
    TABLE "actor" CONSTRAINT "actor_actor_definition_id_fkey" FOREIGN KEY (actor_definition_id) REFERENCES actor_definition(id) ON DELETE CASCADE
    TABLE "actor_oauth_parameter" CONSTRAINT "actor_oauth_parameter_actor_definition_id_fkey" FOREIGN KEY (actor_definition_id) REFERENCES actor_definition(id) ON DELETE CASCADE




                                   Table "public.actor"
       Column        |           Type           | Collation | Nullable |      Default
---------------------+--------------------------+-----------+----------+-------------------
 id                  | uuid                     |           | not null |
 workspace_id        | uuid                     |           | not null |
 actor_definition_id | uuid                     |           | not null |
 name                | character varying(256)   |           | not null |
 configuration       | jsonb                    |           | not null |
 actor_type          | actor_type               |           | not null |
 tombstone           | boolean                  |           | not null | false
 created_at          | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at          | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "actor_pkey" PRIMARY KEY, btree (id)
    "actor_actor_definition_id_idx" btree (actor_definition_id)
Foreign-key constraints:
    "actor_actor_definition_id_fkey" FOREIGN KEY (actor_definition_id) REFERENCES actor_definition(id) ON DELETE CASCADE
    "actor_workspace_id_fkey" FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE
Referenced by:
    TABLE "connection" CONSTRAINT "connection_destination_id_fkey" FOREIGN KEY (destination_id) REFERENCES actor(id) ON DELETE CASCADE
    TABLE "connection" CONSTRAINT "connection_source_id_fkey" FOREIGN KEY (source_id) REFERENCES actor(id) ON DELETE CASCADE




                           Table "public.actor_oauth_parameter"
       Column        |           Type           | Collation | Nullable |      Default
---------------------+--------------------------+-----------+----------+-------------------
 id                  | uuid                     |           | not null |
 workspace_id        | uuid                     |           |          |
 actor_definition_id | uuid                     |           | not null |
 configuration       | jsonb                    |           | not null |
 actor_type          | actor_type               |           | not null |
 created_at          | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at          | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "actor_oauth_parameter_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
    "actor_oauth_parameter_actor_definition_id_fkey" FOREIGN KEY (actor_definition_id) REFERENCES actor_definition(id) ON DELETE CASCADE



                                   Table "public.operation"
         Column         |           Type           | Collation | Nullable |      Default
------------------------+--------------------------+-----------+----------+-------------------
 id                     | uuid                     |           | not null |
 workspace_id           | uuid                     |           | not null |
 name                   | character varying(256)   |           | not null |
 operator_type          | operator_type            |           | not null |
 operator_normalization | jsonb                    |           |          |
 operator_dbt           | jsonb                    |           |          |
 tombstone              | boolean                  |           | not null | false
 created_at             | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at             | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "operation_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
    "operation_workspace_id_fkey" FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE
Referenced by:
    TABLE "connection_operation" CONSTRAINT "connection_operation_operation_id_fkey" FOREIGN KEY (operation_id) REFERENCES operation(id) ON DELETE CASCADE




                                  Table "public.connection"
        Column         |           Type            | Collation | Nullable |      Default
-----------------------+---------------------------+-----------+----------+-------------------
 id                    | uuid                      |           | not null |
 namespace_definition  | namespace_definition_type |           | not null |
 namespace_format      | character varying(256)    |           |          |
 prefix                | character varying(256)    |           |          |
 source_id             | uuid                      |           | not null |
 destination_id        | uuid                      |           | not null |
 name                  | character varying(256)    |           | not null |
 catalog               | jsonb                     |           | not null |
 status                | status_type               |           |          |
 schedule              | jsonb                     |           |          |
 manual                | boolean                   |           | not null |
 resource_requirements | jsonb                     |           |          |
 created_at            | timestamp with time zone  |           | not null | CURRENT_TIMESTAMP
 updated_at            | timestamp with time zone  |           | not null | CURRENT_TIMESTAMP
Indexes:
    "connection_pkey" PRIMARY KEY, btree (id)
    "connection_destination_id_idx" btree (destination_id)
    "connection_source_id_idx" btree (source_id)
Foreign-key constraints:
    "connection_destination_id_fkey" FOREIGN KEY (destination_id) REFERENCES actor(id) ON DELETE CASCADE
    "connection_source_id_fkey" FOREIGN KEY (source_id) REFERENCES actor(id) ON DELETE CASCADE
Referenced by:
    TABLE "connection_operation" CONSTRAINT "connection_operation_connection_id_fkey" FOREIGN KEY (connection_id) REFERENCES connection(id) ON DELETE CASCADE
    TABLE "state" CONSTRAINT "state_connection_id_fkey" FOREIGN KEY (connection_id) REFERENCES connection(id) ON DELETE CASCADE




                         Table "public.connection_operation"
    Column     |           Type           | Collation | Nullable |      Default
---------------+--------------------------+-----------+----------+-------------------
 id            | uuid                     |           | not null |
 connection_id | uuid                     |           | not null |
 operation_id  | uuid                     |           | not null |
 created_at    | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at    | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "connection_operation_pkey" PRIMARY KEY, btree (id, connection_id, operation_id)
Foreign-key constraints:
    "connection_operation_connection_id_fkey" FOREIGN KEY (connection_id) REFERENCES connection(id) ON DELETE CASCADE
    "connection_operation_operation_id_fkey" FOREIGN KEY (operation_id) REFERENCES operation(id) ON DELETE CASCADE




                                Table "public.state"
    Column     |           Type           | Collation | Nullable |      Default
---------------+--------------------------+-----------+----------+-------------------
 id            | uuid                     |           | not null |
 connection_id | uuid                     |           | not null |
 state         | jsonb                    |           |          |
 created_at    | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at    | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
Indexes:
    "state_pkey" PRIMARY KEY, btree (id, connection_id)
Foreign-key constraints:
    "state_connection_id_fkey" FOREIGN KEY (connection_id) REFERENCES connection(id) ON DELETE CASCADE

