11from piccolo .columns import Integer
22
3- from ..base import DBTestCase
3+ from ..base import DBTestCase , postgres_only
44from ..example_project .tables import Band , Manager
55
66
@@ -26,8 +26,14 @@ def test_rename_column(self):
2626 self ._test_rename ("popularity" )
2727
2828
29- class TestDrop (DBTestCase ):
30- def _test_drop (self , column ):
29+ @postgres_only
30+ class TestDropColumn (DBTestCase ):
31+ """
32+ Unfortunately this only works with Postgres at the moment.
33+
34+ SQLite has very limited support for ALTER statements.
35+ """
36+ def _test_drop (self , column : str ):
3137 self .insert_row ()
3238
3339 Band .alter ().drop_column (column ).run_sync ()
@@ -64,6 +70,7 @@ def test_add(self):
6470 self .assertEqual (response [0 ]["weight" ], None )
6571
6672
73+ @postgres_only
6774class TestUnique (DBTestCase ):
6875 def test_unique (self ):
6976 unique_query = Manager .alter ().set_unique (Manager .name , True )
@@ -90,6 +97,8 @@ def test_unique(self):
9097 self .assertTrue (len (response ), 2 )
9198
9299
100+ # TODO - make it work for SQLite. Should work.
101+ @postgres_only
93102class TestMultiple (DBTestCase ):
94103 """
95104 Make sure multiple alter statements work correctly.
0 commit comments