Skip to content

Commit

Permalink
add id: Serial annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Nov 30, 2023
1 parent b42f891 commit c05bb5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/table/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from piccolo.columns import Integer, Varchar
from piccolo.columns import Integer, Serial, Varchar
from piccolo.query.methods.insert import OnConflictAction
from piccolo.table import Table
from piccolo.utils.lazy_loader import LazyLoader
Expand Down Expand Up @@ -98,6 +98,7 @@ def test_insert_returning_alias(self):
)
class TestOnConflict(TestCase):
class Band(Table):
id: Serial
name = Varchar(unique=True)
popularity = Integer()

Expand Down
6 changes: 4 additions & 2 deletions tests/table/test_join_on.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
from unittest import TestCase

from piccolo.columns import Varchar
from piccolo.columns import Serial, Varchar
from piccolo.table import Table


class Manager(Table):
id: Serial
name = Varchar(unique=True)
email = Varchar(unique=True)


class Band(Table):
id: Serial
name = Varchar(unique=True)
manager_name = Varchar()


class Concert(Table):
id: Serial
title = Varchar()
band_name = Varchar()


class TestJoinOn(TestCase):

tables = [Manager, Band, Concert]

def setUp(self):
Expand Down

0 comments on commit c05bb5d

Please sign in to comment.