tddl sample

drop database if exists diamond;

CREATE DATABASE `diamond`

use diamond

create table config_info (
`id` bigint(64) unsigned NOT NULL auto_increment,
`data_id` varchar(255) NOT NULL default ' ',
`group_id` varchar(128) NOT NULL default ' ',
`content` longtext NOT NULL,
`md5` varchar(32) NOT NULL default ' ',
`src_ip` varchar(20) default NULL,
`src_user` varchar(20) default NULL,
`gmt_create` datetime NOT NULL default '2010-05-05 00:00:00',
`gmt_modified` datetime NOT NULL default '2010-05-05 00:00:00',
PRIMARY KEY  (`id`),
UNIQUE KEY `uk_config_datagroup` (`data_id`,`group_id`)
);

create table group_info (
`id` bigint(64) unsigned NOT NULL auto_increment,
`address` varchar(70) NOT NULL default ' ',
`data_id` varchar(255) NOT NULL default ' ',
`group_id` varchar(128) NOT NULL default ' ',
`src_ip` varchar(20) default NULL,
`src_user` varchar(20) default NULL,
`gmt_create` datetime NOT NULL default '2010-05-05 00:00:00',
`gmt_modified` datetime NOT NULL default '2010-05-05 00:00:00',
PRIMARY KEY  (`id`),
UNIQUE KEY `uk_group_address` (`address`,`data_id`,`group_id`)
);






drop database if exists qatest_normal_0;

CREATE DATABASE `qatest_normal_0`

use qatest_normal_0

CREATE TABLE `normaltbl_0001` (
`pk` int(11) NOT NULL,
`id` int(11) DEFAULT NULL,
`gmt_create` date DEFAULT '2010-12-17',
`name` varchar(30) DEFAULT NULL,
`floatCol` float(9,3) DEFAULT '0.000',
PRIMARY KEY (`pk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;




CREATE USER 'tddl'@'%' IDENTIFIED BY 'tddl';
GRANT Insert,Update,Select,Delete ON qatest_normal_0.* TO 'tddl'@'%';

 

 

将/diamond-utils/src/main/java/com/taobao/diamond/common/Constants.java

改为如下值。

    public static final String HTTP_URI_FILE = "/diamond-server/config.co";
    public static final String CONFIG_HTTP_URI_FILE = "/diamond-server/diamond";

 

你可能感兴趣的:(sample)