Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
zendata
提交
124d2b04
Z
zendata
项目概览
LinuxSuRen
/
zendata
与 Fork 源项目一致
Fork自
易企天创 / zendata
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
124d2b04
编写于
6月 03, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test ddl to yaml files
上级
0680a253
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
4 deletion
+67
-4
test/definition/_ddl.sql
test/definition/_ddl.sql
+36
-0
test/definition/inherit.yaml
test/definition/inherit.yaml
+2
-2
test/script/ddlToYaml.exp
test/script/ddlToYaml.exp
+2
-1
test/script/ddlToYaml.php
test/script/ddlToYaml.php
+26
-0
test/script/fieldInherit.php
test/script/fieldInherit.php
+1
-1
未找到文件。
test/definition/_ddl.sql
0 → 100644
浏览文件 @
124d2b04
-- 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
test/definition/inherit.yaml
浏览文件 @
124d2b04
...
...
@@ -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
test/script/ddlToYaml.exp
浏览文件 @
124d2b04
>> '192.168.0.1-192.168.1.2'
\ No newline at end of file
>> 104
>> field: id
\ No newline at end of file
test/script/ddlToYaml.php
100644 → 100755
浏览文件 @
124d2b04
#!/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
test/script/fieldInherit.php
浏览文件 @
124d2b04
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录