@@ -185,42 +185,13 @@ def output_graph(self, dest, override):
185
185
}
186
186
_output .append (generator .label (** _table_data ))
187
187
188
- content = '' .join (_output )
188
+ labels = '' .join (_output )
189
+
190
+ content = generator .graph (labels , '' )
189
191
190
192
with open (dest , 'w' ) as f :
191
193
f .write (content )
192
194
193
- def format_db_graph (self , table , columns ):
194
- """
195
- :param table:
196
- :param columns:
197
- :return:
198
- """
199
- generator = self .graph_generator
200
-
201
- _output = list ()
202
-
203
- # 表名
204
- table_name = table .name
205
- table_comment = ''
206
- if table .comment :
207
- table_comment = table .comment
208
- else :
209
- if table .name in self .migration_tables :
210
- table_comment = self .migration_tables [table .name ]
211
-
212
- # _output.append("%s %s" % (generator.highline(table.engine), generator.highline(table.collation)))
213
- # 字段输出
214
- _table_data = {
215
- 'table_name' : table .name ,
216
- 'table_comment' : table_comment ,
217
- # 'columns': ['字段名', '类型', '是否可NULL', '描述'],
218
- 'data' : [[column .name , column .field_type , column .if_null , column .comment .replace (os .linesep , '' )] for column
219
- in columns ],
220
- }
221
- _output .append (generator .label (** _table_data ))
222
- return _output
223
-
224
195
def output_markdown (self , dest , override , gitlab = False ):
225
196
226
197
self .init_path (dest , override )
0 commit comments