sqlite-utils transform --column-order option, closes #176

This commit is contained in:
Simon Willison 2020-09-24 09:11:53 -07:00
commit d13c123100
3 changed files with 10 additions and 0 deletions

View file

@ -1496,6 +1496,10 @@ def test_add_foreign_keys(db_path):
["--default-none", "age"],
'CREATE TABLE "dogs" (\n [id] INTEGER PRIMARY KEY,\n [age] INTEGER NOT NULL,\n [name] TEXT\n)',
),
(
["-o", "name", "--column-order", "age", "-o", "id"],
"CREATE TABLE \"dogs\" (\n [name] TEXT,\n [age] INTEGER NOT NULL DEFAULT '1',\n [id] INTEGER PRIMARY KEY\n)",
),
],
)
def test_transform(db_path, args, expected_schema):