1
0
Fork 0

Update schema

This commit is contained in:
Gregory Eremin 2015-03-14 23:28:40 +07:00
parent 7d61d36fc3
commit aff38168b7
2 changed files with 46 additions and 322 deletions

View File

@ -1,5 +1,5 @@
DROP TABLE IF EXISTS `contributions`;
CREATE TABLE `contributions` (
DROP TABLE IF EXISTS `contribs`;
CREATE TABLE `contribs` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`week` int(11) unsigned NOT NULL,
`author` varchar(255) NOT NULL DEFAULT '',
@ -22,17 +22,20 @@ CREATE TABLE `hooks` (
DROP TABLE IF EXISTS `members`;
CREATE TABLE `members` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`team_id` int(10) unsigned NOT NULL,
`login` varchar(255) NOT NULL DEFAULT '',
`org` varchar(255) NOT NULL DEFAULT '',
`team_id` int(11) unsigned DEFAULT NULL,
`user` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `team` (`team_id`),
KEY `login` (`login`)
KEY `login` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `owners`;
CREATE TABLE `owners` (
DROP TABLE IF EXISTS `orgs`;
CREATE TABLE `orgs` (
`login` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) DEFAULT NULL,
`descr` varchar(255) NOT NULL DEFAULT '',
`id` int(11) unsigned NOT NULL,
`avatar_url` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`login`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -48,34 +51,11 @@ CREATE TABLE `repos` (
UNIQUE KEY `owner_repo` (`owner`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `teams`;
CREATE TABLE `teams` (
`id` int(11) unsigned NOT NULL,
`owner` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `owner` (`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`owner` varchar(255) NOT NULL DEFAULT '',
`token` varchar(40) NOT NULL DEFAULT '',
`limit` int(11) unsigned NOT NULL,
`remaining` int(11) unsigned NOT NULL,
`reset_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `owner` (`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE `tasks` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`token` varchar(255) NOT NULL,
`owner` varchar(255) NOT NULL DEFAULT '',
`token` varchar(255) DEFAULT '',
`owner` varchar(255) DEFAULT '',
`job` varchar(255) NOT NULL DEFAULT '',
`worker` varchar(36) NOT NULL DEFAULT '',
`duration` int(11) unsigned NOT NULL,
@ -84,3 +64,36 @@ CREATE TABLE `tasks` (
`started_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `teams`;
CREATE TABLE `teams` (
`id` int(11) unsigned NOT NULL,
`slug` varchar(255) NOT NULL,
`owner` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `owner` (`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL DEFAULT '',
`token` varchar(40) NOT NULL DEFAULT '',
`quota` int(11) unsigned NOT NULL,
`remaining` int(11) unsigned NOT NULL,
`reset_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `owner` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`login` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
`id` int(11) unsigned NOT NULL,
`avatar_url` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`login`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -23,292 +23,3 @@ func apiReposHandler(w http.ResponseWriter, r *http.Request) {
repos := db.OrgRepos(stat.Org)
req.respondWith(repos)
}
func apiSyncUsersHandler(w http.ResponseWriter, r *http.Request) {
_ = []string{
"rs",
"henrik",
"Rakoth",
"anton-ferio",
"Pavliko",
"codesnik",
"abragin",
"mszakharov",
"aki-russia",
"eliog",
"alfuken",
"nickzayarny",
"inque",
"Exoth",
"julik",
"WebwinkeleninNL",
"dafa",
"XXXVII",
"undr",
"vesterbaek",
"floatbox",
"siuying",
"adamjernst",
"exalted",
"kslazarev",
"waaa",
"sevabill",
"MitryBur",
"nonamelive",
"neogithub",
"unintended",
"yurieasy",
"fsaragoca",
"pyromaniac",
"AntonKozlovsky",
"bskaplou",
"Scull007",
"vzzhobbot",
"seviu",
"zynaps",
"ecentinela",
"besi",
"peanut",
"sannysoft",
"tvon",
"andybee",
"cbowns",
"muhku",
"athasach",
"fannheyward",
"piotrb",
"rickygu",
"jcole",
"Xenofex",
"phabricator",
"arr-ee",
"clowwindy",
"gotosleep",
"rshevchuk",
"acoomans",
"andreyzakharevich",
"b1uebyte",
"andrewgr",
"nivektric",
"rmustafin",
"allaud",
"grampe",
"dittos",
"jianlin",
"hruschev",
"svetadob",
"ajoslin",
"erlikh",
"kurige",
"dbushell",
"dhruv-bhatia",
"dimaivanov",
"JaviSoto",
"NachoSoto",
"pkozlowski-opensource",
"rikkert",
"jurezove",
"mattrobenolt",
"tirsen",
"Vitalina",
"ericzou",
"SRandazzo",
"matej",
"typesafe",
"zvirusz",
"arbarlow",
"localhots",
"nurikk",
"chicoxyzzy",
"petebacondarwin",
"reidmain",
"kawanet",
"aburgel",
"achwedyk",
"joshdmiller",
"ramandv",
"Reflejo",
"richardTowers",
"just-boris",
"Pashugan",
"tiagoroldao",
"ballmw",
"nelsonmenezes",
"SidhNor",
"ciplazar",
"skivvies",
"theDoug",
"thiagofelix",
"inamiy",
"marknadig",
"nogizhopaboroda",
"STAH",
"joshkurz",
"n-miyo",
"nebillo",
"antonellopasella",
"bekos",
"sebreh",
"bm-i",
"mraible",
"Timrael",
"anton-dev-ua",
"christianv",
"ezotrank",
"Kapin",
"themikelee",
"ubernil",
"gnesher",
"jparise",
"shaungrady",
"thisboyiscrazy",
"u16suzu",
"vadv",
"Vyazovoy",
"andr0s",
"dylanlingelbach",
"eweast",
"es128",
"L42y",
"0xced",
"jonbcard",
"lastnico",
"mxparajuli",
"sanyek",
"bowenisdum",
"garthex",
"lavoy",
"MoOx",
"adam77",
"PowerKiKi",
"amirhhz",
"dredozubov",
"gsklee",
"BB9z",
"docallag",
"Charuru",
"elwayman02",
"mokesmokes",
"chebotovanton",
"dalexsoto",
"lukasz-zak",
"nimdraugsael",
"nils-wisiol",
"nishesj",
"owenmead",
"tanyafn",
"hsoi",
"khalilravanna",
"lsiv568",
"Paulche",
"Kudrik",
"lgalfaso",
"masarusanjp",
"tissak",
"DeLaGuardo",
"IgorYurchenko",
"lazychino",
"maxbeatty",
"nonmanifold",
"psgibbs",
"gringoireDM",
"shifu",
"alachaum",
"DanWahlin",
"jdecool",
"Swiip",
"bquorning",
"chrisirhc",
"ikesyo",
"mysza",
"pennig",
"KoryNunn",
"longlongjump",
"scamden",
"gabro",
"hkjorgensen",
"otmosina",
"donholly",
"eddiemonge",
"jimrollenhagen",
"ianjosephwilson",
"nenemo",
"tkothe",
"jbruni",
"mrmrs",
"Sanjo",
"arve0",
"joshuacc",
"MaarOfOz",
"prkoat",
"stan-z",
"fotonstep",
"luisobo",
"martco",
"metimus",
"raylillywhite",
"scarletsky",
"fidian",
"sibljon",
"garnett",
"musically-ut",
"robertmryan",
"seankenny",
"tardyp",
"danpe",
"mismith",
"crazytonyli",
"mknippen",
"cbebry",
"milaniliev",
"pieterclaerhout",
"pyp",
"bpoplauschi",
"dmitry-dedukhin",
"erikcharlebois",
"jenshandersson",
"selfservices",
"kosyan",
"fikriy",
"akhenakh",
"burakkilic",
"hlian",
"runmad",
"limbo-lab",
"Whirlwind",
"finik",
"taichino",
"T-Pham",
"jeffleeismyhero",
"fliptheweb",
"herrernst",
"salling",
"ivankozlov",
"gertsonderby",
"reydan",
"stuartmcfarlane",
"EngExp",
"nkabardin",
"rivera-ernesto",
"a-wart",
"dchohfi",
"martinblech",
"nickhingston",
"rmaz",
"schmidp",
"adampierson",
"pycoff",
"graingert",
"AJIekseys",
"yegortimoschenko",
"benfoxall",
"thomasboyt",
"Kr00lIX",
"scythargon",
"glassoff",
"mainfish",
"Kpeved",
"tagirshine",
"nancefulness",
}
}