Forums

MySQL create table error

Hi,

I'm trying to create a table and getting an error on the first column. Doesn't like UNSIGNED. How do I correctly add this? I'm following the beginner's guide part 1 using Python 3.6, flask and mysql.

class Future(db.Model):
    __tablename__ = 'future'
    id = db.Column(db.Integer, primary_key = True) UNSIGNED 
    timestamp = db.Column(db.TIMESTAMP) DEFAULT CURRENT_TIMESTAMP   ON UPDATE CURRENT_TIMESTAMP 
    date = db.Column(db.DateTime)
    description = db.Column(db.String(4096), nullable = False)
    amount = db.Column(db.DECIMAL(65,2) UNSIGNED

SyntaxError: invalid syntax

[edited by admin: formatting]

hmm- is that your python code? If so, yes that extra "UNSIGNED" is invalid syntax. why do you think you need that there? (why not just remove it- what told you to add it there?)

The DEFAULT CURRENT_TIMESTAMP etc is also invalid syntax the line below.