提交 124d2b04 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

test ddl to yaml files

上级 0680a253
-- DROP TABLE IF EXISTS `zt_action`;
CREATE TABLE IF NOT EXISTS `zt_action` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`objectType` varchar(30) NOT NULL default '',
`objectID` mediumint(8) unsigned NOT NULL default '0',
`product` varchar(255) NOT NULL,
`project` mediumint(9) NOT NULL,
`actor` varchar(100) NOT NULL default '',
`action` varchar(30) NOT NULL default '',
`date` datetime NOT NULL,
`comment` text NOT NULL,
`extra` text NOT NULL,
`read` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `date` (`date`),
KEY `actor` (`actor`),
KEY `project` (`project`),
KEY `objectID` (`objectID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_block`;
CREATE TABLE IF NOT EXISTS `zt_block` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`account` char(30) NOT NULL,
`module` varchar(20) NOT NULL,
`title` varchar(100) NOT NULL,
`source` varchar(20) NOT NULL,
`block` varchar(20) NOT NULL,
`params` text NOT NULL,
`order` tinyint(3) unsigned NOT NULL DEFAULT '0',
`grid` tinyint(3) unsigned NOT NULL DEFAULT '0',
`height` smallint(5) unsigned NOT NULL DEFAULT '0',
`hidden` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`),
KEY `account` (`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
\ No newline at end of file
......@@ -5,14 +5,14 @@ version: 1.0
fields:
- field: basic
note: 继承基本字段
note: inherit from basic field
loop: 2
loopfix: " "
prefix: "{"
postfix: "}"
- field: refer2
note: 继承引用字段
note: inherit from reference field
loop: 2
prefix: "="
postfix: "-"
\ No newline at end of file
>> '192.168.0.1-192.168.1.2'
\ No newline at end of file
>> 104
>> field: id
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=generate yaml from database table ddl
cid=0
pid=0
[group]
1. count >>
2. line of id field >>
[esac]
*/
$output = [];
exec('./zd-mac -i ../test/definition/_ddl.sql -o ../test/output', $output);
$str = join("\n", $output);
print("$str\n");
$content = file_get_contents('../test/output/zt_action.yaml');
$arr = explode("\n", $content);
$count = sprintf("%d", count($arr));
print(">> $count\n");
$line = $arr[5];
print(">> $line\n");
\ No newline at end of file
......@@ -2,7 +2,7 @@
<?php
/**
[case]
title=field
title=field inherit
cid=0
pid=0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册