Skip to content

Commit 3ec811c

Browse files
authored
Merge pull request #347 from tinybirdco/341-use-case-drop-column
Drop column version from analytics_events
2 parents e5fba9a + 20487a0 commit 3ec811c

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

drop_column/README.MD

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Alter datasource removing a column
2+
3+
[Pull Request](https://github.com/tinybirdco/use-case-examples/pull/347)
4+
5+
- Just remove the column from the schema and apply the changes. If there are dependent materialized views the CLI will list them and ask for confirmation.
6+
7+
8+
```diff
9+
SCHEMA >
10+
- `version` LowCardinality(String) `json:$.version`,
11+
```
12+
13+
- Create a PR with the change above, a new branch will be created as part of the CI process. You can double check the changes checking the datasource schema.
14+
15+
- To deploy the change, merge to PR to you main branch, the CD job will run and will deploy the changes.
16+
17+
```
18+
...
19+
** Detecting changes from last commit ...
20+
** Diffs from current commit '3afc8032b98c2f961e370fc1dda10b2a783fdc02' and new 'b0d520d2b0a2077326cd71a8111c7e6daa97048c':
21+
modified: drop_column/datasources/analytics_events.datasource
22+
23+
** Preparing commit ...
24+
** Processing ./datasources/analytics_events.datasource
25+
** Building dependencies
26+
27+
** [DRY RUN] Deploying commit ...
28+
** [DRY RUN] Running 'analytics_events'
29+
30+
** Deploying commit ...
31+
** Running 'analytics_events'
32+
** The description or schema of 'analytics_events' has changed.
33+
** - DROP COLUMN `version`
34+
** The Data Source has been correctly updated.
35+
** 'analytics_events' created
36+
** Not pushing fixtures
37+
...
38+
```

drop_column/datasources/analytics_events.datasource

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ SCHEMA >
77
`timestamp` DateTime `json:$.timestamp`,
88
`session_id` String `json:$.session_id`,
99
`action` LowCardinality(String) `json:$.action`,
10-
`version` LowCardinality(String) `json:$.version`,
1110
`payload` String `json:$.payload`
1211

1312
ENGINE "MergeTree"

0 commit comments

Comments
 (0)