blag / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Additional default rows in new table #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have found how to add a new default row when adding a new table via the 
SQL.TableManager.prototype.click() function.  My question is, can you change 
any of the default values when creating a new row?

My goal is to have each new table include an `id` and `timestamp`.

Original issue reported on code.google.com by mcdaniel...@gmail.com on 18 Sep 2012 at 3:21

GoogleCodeExporter commented 9 years ago
As you can see, new rows are added like this (line 1678, the function you 
mentioned):

var r = newtable.addRow("id", {ai:true});

The first argument is a row's name; the second object can have the following 
keys:

type: index to a type definition set
size: length (for sized types)
def: default value
nll: nullable?
ai: autoincrement?
comment: row comment

Original comment by ondrej.zara on 18 Sep 2012 at 2:00

GoogleCodeExporter commented 9 years ago
This was great information and is going to greatly speed up my development.  
Thanks for your help and quick response!

Original comment by mcdaniel...@gmail.com on 19 Sep 2012 at 1:37

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 19 Sep 2012 at 7:36