Skip to content

[FEATURE]:Support multiple branch development ? #1221

Open
@abcfy2

Description

@abcfy2

Describe what you want

When we develop on different branches, will cause migrate sql lost when merge.

This because of the sql:

Query: CREATE SCHEMA IF NOT EXISTS "drizzle"
Query: 
			CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" (
				id SERIAL PRIMARY KEY,
				hash text NOT NULL,
				created_at bigint
			)
		
Query: select id, hash, created_at from "drizzle"."__drizzle_migrations" order by created_at desc limit 1
Query: begin
Query: commit

When I generate migrate sql on different branches, will cause conflict. See the final result:

❯ tree drizzle
drizzle
├── 0000_calm_talos.sql
├── 0001_reflective_malice.sql
├── 0002_careful_northstar.sql
├── 0003_blushing_martin_li.sql
├── 0004_bumpy_katie_power.sql
├── 0004_even_cyclops.sql
├── 0006_luxuriant_bloodscream.sql
└── meta
    ├── 0000_snapshot.json
    ├── 0001_snapshot.json
    ├── 0002_snapshot.json
    ├── 0003_snapshot.json
    ├── 0004_snapshot.json
    ├── 0006_snapshot.json
    └── _journal.json

2 directories, 14 files

You can see there're 2 0004_ sqls here.

So if 0004_even_cyclops.sql first migrate, then merge branch with file 0004_bumpy_katie_power.sql, will cause 0004_bumpy_katie_power.sql never execute, this because the sql of migrate:

select id, hash, created_at from "drizzle"."__drizzle_migrations" order by created_at desc limit 1

I hope you can support multiple branches development. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions