Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE DATABASE creates two commits in the log. #729

Open
timsehn opened this issue Sep 20, 2024 · 0 comments
Open

CREATE DATABASE creates two commits in the log. #729

timsehn opened this issue Sep 20, 2024 · 0 comments

Comments

@timsehn
Copy link
Collaborator

timsehn commented Sep 20, 2024

Ideally, CREATE DATABASE should be a single commit at the head of the log.

doltgres=> create database getting_started;
CREATE DATABASE
doltgres=> \c getting_started;
psql (15.4 (Homebrew), server 15.0)
You are now connected to database "getting_started" as user "doltgres".
getting_started=> create table employees (
    id int8,
    last_name text,
    first_name text,
    primary key(id));
CREATE TABLE
getting_started=> create table teams (
    id int8,
    team_name text,
    primary key(id));
CREATE TABLE
getting_started=> create table employees_teams(
    team_id int8,
    employee_id int8,
    primary key(team_id, employee_id),
    foreign key (team_id) references teams(id),
    foreign key (employee_id) references employees(id));
CREATE TABLE
getting_started=> select dolt_commit('-Am', 'Created tables');
            dolt_commit             
------------------------------------
 {uloh753ugjhoddgb2v2e6rkupr2lnjh5}
(1 row)

getting_started=> select * from dolt_log;
           commit_hash            | committer |       email        |        date         |          message           
----------------------------------+-----------+--------------------+---------------------+----------------------------
 uloh753ugjhoddgb2v2e6rkupr2lnjh5 | doltgres  | [email protected] | 2024-09-20 20:55:58 | Created tables
 15iiq73epce96ops9mdtu7kbcu4i0609 | doltgres  | [email protected] | 2024-09-20 20:49:58 | CREATE DATABASE
 ttg8o7ld6cdgiahbrhv8jaeioot42k2h | timsehn   | [email protected]    | 2024-09-20 20:49:58 | Initialize data repository
(3 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant