Comments (2)
I tested it with your setup and it worked.
I did few more tests. Seems that it's not an issue of dbmate, but a ClickHouse issue.
I can reproduce it with ClickHouse 21.8.13, but with the latest versions it works fine.
Closing the issue
from dbmate.
I tried to reproduce this with the latest dbmate v2.10 and ClickHouse 22.8.21.38 on Ubuntu 20.04.6 LTS, and could not reproduce with this:
$ mkdir issue_503
$ printf -- '-- migrate:up\ncreate table some_table (some_column int) engine=MergeTree order by some_column;\n-- migrate:down\n' > issue_503/20240105002500_create_table.sql
$ printf -- '-- migrate:up\ncreate view some_view as (select t.some_column from some_table as t);\n-- migrate:down\n' > issue_503/20240105002501_create_view.sql
$ dist/dbmate -u $CLICKHOUSE_TEST_URL -d issue_503 drop
$ dist/dbmate -u $CLICKHOUSE_TEST_URL -d issue_503 -s issue_503/schema.sql up
$ cat issue_503/schema.sql
Output:
root@ac78f31eadc5:/src# mkdir issue_503
root@ac78f31eadc5:/src# printf -- '-- migrate:up\ncreate table some_table (some_column int) engine=MergeTree order by some_column;\n-- migrate:down\n' > issue_503/20240105002500_create_table.sql
root@ac78f31eadc5:/src# printf -- '-- migrate:up\ncreate view some_view as (select t.some_column from some_table as t);\n-- migrate:down\n' > issue_503/20240105002501_create_view.sql
root@ac78f31eadc5:/src# dist/dbmate -u $CLICKHOUSE_TEST_URL -d issue_503 drop
Dropping: dbmate_test
root@ac78f31eadc5:/src# dist/dbmate -u $CLICKHOUSE_TEST_URL -d issue_503 -s issue_503/schema.sql up
Creating: dbmate_test
Applying: 20240105002500_create_table.sql
Applying: 20240105002501_create_view.sql
Writing: issue_503/schema.sql
root@ac78f31eadc5:/src# cat issue_503/schema.sql
--
-- Database schema
--
CREATE DATABASE IF NOT EXISTS dbmate_test;
CREATE TABLE dbmate_test.schema_migrations
(
`version` String,
`ts` DateTime DEFAULT now(),
`applied` UInt8 DEFAULT 1
)
ENGINE = ReplacingMergeTree(ts)
PRIMARY KEY version
ORDER BY version
SETTINGS index_granularity = 8192;
CREATE TABLE dbmate_test.some_table
(
`some_column` Int32
)
ENGINE = MergeTree
ORDER BY some_column
SETTINGS index_granularity = 8192;
CREATE VIEW dbmate_test.some_view
(
`some_column` Int32
) AS
SELECT t.some_column
FROM dbmate_test.some_table AS t;
--
-- Dbmate schema migrations
--
INSERT INTO schema_migrations (version) VALUES
('20240105002500'),
('20240105002501');
If you can provide a minimal reproducible example of the issue, I'll try to see if I can reproduce it.
from dbmate.
Related Issues (20)
- Migration table is not found HOT 3
- Dbmate Unable to Create SchemaMigrations Table HOT 6
- Postgres Schemas with special characters have DBMate create migration tables then cannot find it again
- ClickHouse Cloud https connection doesn't work HOT 2
- Getting pq: syntax error at or near "transaction" when running migration with transaction:false HOT 7
- The migration lock is not released after terminating the migration HOT 2
- Comments (on columns) that include line breaks are never created. HOT 1
- dbmate requires each migration to define a down block with '-- migrate:down' when it defined HOT 5
- No Zookeeper configuration in server config
- Support all DSN variants for clickhouse DATABASE_URL HOT 8
- Wait for Postgres to be ready HOT 3
- $PGHOST & $PGPORT are not respected. HOT 2
- Add a section to the README documenting how environment variables are used by dbmate
- Add `--wait-interval` and `$DBMATE_WAIT_INTERVAL` to make wait interval configurable at runtime HOT 7
- The latest release is missing all the binaries HOT 2
- Could not open extension control file "/share/extension/http.control" HOT 2
- Embedded FS on Windows HOT 2
- `make docker-all` timeout when run locally. HOT 1
- DBMate always delets my database anytime I run a migration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbmate.