Skip to content

Commit

Permalink
doc/md: fix clickhouse guide example (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
hilakashai authored Jan 31, 2024
1 parent fda4333 commit 5c84752
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion doc/md/guides/clickhouse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,10 @@ atlas schema apply \
```shell
atlas schema apply \
-u "clickhouse://localhost:9000/demo" \
--to file://schema.hcl
--to file://schema.sql \
--dev-url "docker://clickhouse/23.11/demo"
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -300,12 +301,27 @@ To create our first migration file, we will run the `atlas migrate diff` command
* `--to` the URL of the desired state. A state can be specified using a database URL, HCL or SQL schema, or another migration directory.
* `--dev-url` a URL to a [Dev Database](/concepts/dev-database) that will be used to compute the diff.

<Tabs>
<TabItem value="hcl" label="Atlas DDL (HCL)" default>

```shell
atlas migrate diff initial \
--to file://schema.hcl \
--dev-url "docker://clickhouse/23.11/dev"
```

</TabItem>
<TabItem value="sql" label="SQL">

```shell
atlas migrate diff initial \
--to file://schema.sql \
--dev-url "docker://clickhouse/23.11/dev"
```

</TabItem>
</Tabs>

Run `ls migrations`, and you'll notice that Atlas has automatically created a migration directory for us, as well as
two files:

Expand Down Expand Up @@ -519,12 +535,28 @@ CREATE TABLE `commits` (

Next, let's run the `atlas migrate diff` command once more:


<Tabs>
<TabItem value="hcl" label="Atlas DDL (HCL)" default>

```shell
atlas migrate diff add_commits \
--to file://schema.hcl \
--dev-url "docker://clickhouse/23.11/dev"
```

</TabItem>
<TabItem value="sql" label="SQL">

```shell
atlas migrate diff add_commits \
--to file://schema.sql \
--dev-url "docker://clickhouse/23.11/dev"
```

</TabItem>
</Tabs>

Run `ls migrations`, and you'll notice that a new migration has been generated.

```sql title="20240130141055.sql"
Expand Down

0 comments on commit 5c84752

Please sign in to comment.