Skip to content

Commit b88a609

Browse files
ecmadaod-bytebase
andauthored
chore: move database to project (#59)
* chore: support database data source * fix: lint * chore: support database resource * chore: database resource * fix: lint * Update provider/resource_database.go * Update provider/resource_database.go * chore: move database to project * fix: test --------- Co-authored-by: Danny Xu <[email protected]>
1 parent 1116897 commit b88a609

19 files changed

+312
-773
lines changed

api/project.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ const (
3434
type ProjectSchemaVersion string
3535

3636
const (
37-
// ProjectSchemaVersionTimestamp the timestamp schema version type in the project.
37+
// ProjectSchemaVersionTimestamp is the timestamp schema version type in the project.
3838
ProjectSchemaVersionTimestamp ProjectSchemaVersion = "TIMESTAMP"
39-
// ProjectSchemaVersionSemantic the semantic schema version type in the project.
39+
// ProjectSchemaVersionSemantic is the semantic schema version type in the project.
4040
ProjectSchemaVersionSemantic ProjectSchemaVersion = "SEMANTIC"
41+
// ProjectSchemaVersionUnspecified is the unspecified schema version type in the project.
42+
ProjectSchemaVersionUnspecified ProjectSchemaVersion = "SCHEMA_VERSION_UNSPECIFIED"
4143
)
4244

4345
// ProjectSchemaChange is the schema change type for project.

docs/data-sources/database.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/data-sources/database_list.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/data-sources/project.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,16 @@ The project data source.
3030
- `title` (String) The project title.
3131
- `visibility` (String) The project visibility.
3232
- `workflow` (String) The project workflow.
33+
- `databases` (Block List) The databases in the project. (see [below for nested schema](#nestedblock--databases))
3334

35+
<a id="nestedblock--databases"></a>
36+
### Nested Schema for `databases`
3437

38+
#### Read-Only
39+
40+
- `instance` (String) The instance resource id for the database.
41+
- `name` (String) The database name.
42+
- `labels` (Map of String) The deployment and policy control labels.
43+
- `schema_version` (String) The version of database schema.
44+
- `successful_sync_time` (String) The latest synchronization time.
45+
- `sync_state` (String) The existence of a database on latest sync.

docs/data-sources/project_list.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,16 @@ Read-Only:
3838
- `title` (String)
3939
- `visibility` (String)
4040
- `workflow` (String)
41+
- `databases` (Block List) The databases in the project. (see [below for nested schema](#nestedblock--databases))
4142

43+
<a id="nestedblock--databases"></a>
44+
### Nested Schema for `databases`
4245

46+
#### Read-Only
47+
48+
- `instance` (String) The instance resource id for the database.
49+
- `name` (String) The database name.
50+
- `labels` (Map of String) The deployment and policy control labels.
51+
- `schema_version` (String) The version of database schema.
52+
- `successful_sync_time` (String) The latest synchronization time.
53+
- `sync_state` (String) The existence of a database on latest sync.

docs/resources/database.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/resources/project.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,27 @@ The project resource.
2929
- `db_name_template` (String) The project db name template.
3030
- `tenant_mode` (String) The project tenant mode.
3131
- `visibility` (String) The project visibility. Cannot change this after created
32+
- `databases` (Block List) The databases in the project. (see [below for nested schema](#nestedblock--databases))
3233

3334
### Read-Only
3435

3536
- `id` (String) The ID of this resource.
3637

3738

39+
<a id="nestedblock--databases"></a>
40+
### Nested Schema for `databases`
41+
42+
#### Required
43+
44+
- `instance` (String) The instance resource id for the database.
45+
- `name` (String) The database name.
46+
47+
#### Optional
48+
49+
- `labels` (Map of String) The deployment and policy control labels.
50+
51+
#### Read-Only
52+
53+
- `schema_version` (String) The version of database schema.
54+
- `successful_sync_time` (String) The latest synchronization time.
55+
- `sync_state` (String) The existence of a database on latest sync.

examples/databases/README.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

examples/databases/main.tf

Lines changed: 0 additions & 45 deletions
This file was deleted.

provider/data_source_database.go

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)