-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c85286
commit 6d00e27
Showing
4 changed files
with
27 additions
and
0 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
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,22 @@ | ||
from piccolo.table import Table | ||
from piccolo.columns import Varchar, ForeignKey | ||
|
||
|
||
ID = "2019-11-18T22:24:41" | ||
|
||
|
||
class BaseUser(Table, tablename="piccolo_user"): | ||
pass | ||
|
||
|
||
class TokenAuth(Table): | ||
token = Varchar() | ||
user = ForeignKey(references=BaseUser) | ||
|
||
|
||
async def forwards(): | ||
await TokenAuth.create().run() | ||
|
||
|
||
async def backwards(): | ||
await TokenAuth.alter().drop_table().run() |
Empty file.
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,4 @@ | ||
NAME = "token_auth" | ||
|
||
|
||
DEPENDENCIES = ["piccolo.extensions.user.migrations.config"] |