I'm adding a new column to a table of type JSONB and I can not find the formatting necissary to set the default value to anything other than a empty object.
How would I accomplish this?
Currently my code looks akin to:
new_column     = db.Column(JSONB, server_default=db.text("'{}'"), nullable=False)
I've tried a few ways I thought might be the intuitive way of handeling it. But so far they just cause an error when being run.
Example 1:
new_column     = db.Column(JSONB, server_default=db.text("'{'enabled': True}'"), nullable=False)
Example 2:
new_column     = db.Column(JSONB, server_default=db.text("'{enabled: True}'"), nullable=False)
Ilja Everilä's answer was the answer.  In python I had to format the line of code in the style of:
server_default=db.text("'{\"enabled\": \"true\"}'")
Tripple quotes work too if you don't want escape characters, but this looks nicer to my eyes
Still unsure how I would pass the booleen value of true instead of a string. But that is another question for another time.
How to set a more complex default value for a JSONB column in sqlAlchemy (postgreSQL)