6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\functional\table\alter\test_02.py: Changed datatype from text to integer (SHOW command output often changes for textual fields).

This commit is contained in:
pavel-zotov 2023-10-07 12:59:32 +03:00
parent a98430a677
commit 0a28e27e90

View File

@ -2,28 +2,38 @@
"""
ID: table.alter-02
TITLE: ALTER TABLE - ADD column (test2)
TITLE: ALTER TABLE. Add column with DEFAULT expression, NOT NULL requirement and UNIQUE constraint that must be applied to its values.
DESCRIPTION:
FBTEST: functional.table.alter.02
NOTES:
[07.10.2023] pzotov
Changed datatype from text to integer (SHOW command output often changes for textual fields).
Currently SHOW TABLE remains here but later it can be replaced with query to RDB$ tables.
"""
import pytest
from firebird.qa import *
init_script = """CREATE TABLE test( id INTEGER);
commit;"""
init_script = """
create table test(id integer);
commit;
"""
db = db_factory(init=init_script)
test_script = """ALTER TABLE test ADD text varchar(32) DEFAULT CURRENT_ROLE NOT NULL CONSTRAINT pk PRIMARY KEY;
SHOW TABLE test;"""
test_script = """
alter table test add pid int default current_connection not null constraint test_unq unique;
show table test;
"""
act = isql_act('db', test_script)
expected_stdout = """ID INTEGER Nullable
TEXT VARCHAR(32) Not Null DEFAULT CURRENT_ROLE
CONSTRAINT PK:
Primary key (TEXT)"""
expected_stdout = """
ID INTEGER Nullable
PID INTEGER Not Null default current_connection
CONSTRAINT TEST_UNQ:
Unique key (PID)
"""
@pytest.mark.version('>=3')
def test_1(act: Action):