Went back to each url generating a new token even if they already exist in the database

This commit is contained in:
xemeds
2020-08-21 10:22:01 +03:00
parent 307f7f8f37
commit 17838b61ab
2 changed files with 9 additions and 32 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ from tiny0 import db
class URL(db.Model):
id = db.Column(db.Integer, primary_key=True)
token = db.Column(db.String(6), index=True, unique=True, nullable=False)
url = db.Column(db.String(2000), index=True, unique=True, nullable=False)
url = db.Column(db.String(2000), nullable=False)
def __repr__(self):
return f"'{self.id}' '{self.token}' '{self.url}'"