-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hide_auto_increment option to the entire AUTO_INCREMENT clause
Fix #273
- Loading branch information
Showing
4 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE) | |
|
||
default: test | ||
|
||
ci: depsdev build db test testdoc test_too_many_tables test_json test_ext_subcommand sec doc | ||
ci: depsdev build db test testdoc testdoc_hide_auto_increment test_too_many_tables test_json test_ext_subcommand sec doc | ||
|
||
ci_windows: depsdev build db_sqlite testdoc_sqlite | ||
|
||
|
@@ -77,6 +77,13 @@ testdoc: testdoc_sqlite | |
testdoc_sqlite: | ||
./tbls diff sq://$(PWD)/testdata/testdb.sqlite3 -c testdata/test_tbls.yml sample/sqlite | ||
|
||
testdoc_hide_auto_increment: | ||
usql my://root:mypass@localhost:33308/testdb -c "CREATE DATABASE IF NOT EXISTS auto_increment;" | ||
usql my://root:mypass@localhost:33308/auto_increment -f testdata/ddl/auto_increment.sql | ||
./tbls doc my://root:mypass@localhost:33308/auto_increment?hide_auto_increment -f $(TMPDIR)/auto_increment | ||
usql my://root:mypass@localhost:33308/auto_increment -c "INSERT INTO users (username, password, email, created) VALUES ('alice', 'PASS', '[email protected]', now());" | ||
./tbls diff my://root:mypass@localhost:33308/auto_increment?hide_auto_increment $(TMPDIR)/auto_increment | ||
|
||
test_too_many_tables: | ||
usql pg://postgres:pgpass@localhost:55432/testdb?sslmode=disable -c "DROP DATABASE IF EXISTS too_many;CREATE DATABASE too_many;" | ||
usql pg://postgres:pgpass@localhost:55432/too_many?sslmode=disable -f testdata/ddl/createtable_too_many.sql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DROP TABLE IF EXISTS users; | ||
|
||
CREATE TABLE users ( | ||
id int PRIMARY KEY AUTO_INCREMENT, | ||
username varchar (50) UNIQUE NOT NULL, | ||
password varchar (50) NOT NULL, | ||
email varchar (355) UNIQUE NOT NULL COMMENT 'ex. [email protected]', | ||
created timestamp NOT NULL, | ||
updated timestamp | ||
) COMMENT = 'Users table'; |