擅长:python、mysql、java
<p>加起来是白的column.isNoNull=1在</p>
<pre><code># -*- coding: utf-8 -*-
# MySQL Workbench Python script
# <description>
# Written in MySQL Workbench 6.3.4
import grt
#import mforms
# get a reference to the schema in the model. This will get the 1st schema in it.
schema = grt.root.wb.doc.physicalModels[0].catalog.schemata[0]
# iterate through all tables
for table in schema.tables:
# create a new column object and set its name
column = grt.classes.db_mysql_Column()
column.name = "auditoria_fecha_creacion"
# add it to the table
table.addColumn(column)
# set the datatype of the column
column.setParseType("TIMESTAMP", None)
column.defaultValue = "CURRENT_TIMESTAMP"
column.isNotNull=1
</code></pre>