I find myself building many tables in MySQL Workbench that have the same first three columns:
我发现自己在MySQL Workbench中构建了许多具有相同前三列的表:
- id
- isActive
- lastChanged
Not only are these three columns repeated, but their exact properties (not null, auto increment for the id, default value of 1 for isActive, etc) are also repeated.
这三列不仅重复了,而且它们的确切属性(非空,id的自动递增,isActive的默认值为1等)也会重复。
So my Question:
所以我的问题:
-Does there exist a macro to begin building the table for a given table name, to speed up this process?
- 是否存在一个宏来开始为给定的表名构建表,以加快这个过程?
-If not can someone provide a link to getting me started for building something like this?
- 如果没有人可以提供一个链接,让我开始建立这样的东西?
(Then after using this macro I can fill in the additional columns but the database development time will be less).
(然后在使用此宏之后,我可以填写其他列,但数据库开发时间会更少)。
Thanks!
1 个解决方案
#1
0
The answer to my question - which I thought of based on a great suggestion by Ed Heal (see his comments above), would be to use the SQL Additions to workbench - Snippets.
我的问题的答案 - 我根据Ed Heal的一个很好的建议(参见上面的评论)的想法,将使用SQL Additions到工作台 - 片段。
You can add a new snippet under 'My Snippets' which contains the create table script, rather than maintaining in a text file, and then just fill in the rest of the columns after you do a right mouse + 'insert snippet at text cursor'
您可以在“我的代码段”下添加一个新代码段,其中包含创建表脚本,而不是在文本文件中进行维护,然后在您执行右键+“在文本光标处插入代码段”后填写其余列
#1
0
The answer to my question - which I thought of based on a great suggestion by Ed Heal (see his comments above), would be to use the SQL Additions to workbench - Snippets.
我的问题的答案 - 我根据Ed Heal的一个很好的建议(参见上面的评论)的想法,将使用SQL Additions到工作台 - 片段。
You can add a new snippet under 'My Snippets' which contains the create table script, rather than maintaining in a text file, and then just fill in the rest of the columns after you do a right mouse + 'insert snippet at text cursor'
您可以在“我的代码段”下添加一个新代码段,其中包含创建表脚本,而不是在文本文件中进行维护,然后在您执行右键+“在文本光标处插入代码段”后填写其余列