Tauquir
Tauquir

Reputation: 6913

Add a column to an existing table using GQL?

I have a table having some entries. I want to add a column to that table with some default value.In mysql we it as In mysql:

`ALTER TABLE Example ADD status VARCHAR(60) default 1`

How can I achieve same in GQL (google query language)?

Upvotes: 1

Views: 347

Answers (1)

asdf_enel_hak
asdf_enel_hak

Reputation: 7650

As google datastore is object oriented, it is different from MySql. Once you update your existing model by adding new field to your model class:

class Example(db.Model):    
    #other fields
    status = db.StringProperty()

and

example = Example()
example.status = "Happy new year"
example.put()

you achieve it.

Upvotes: 3

Related Questions