Browse Source

ckdb - change of v0.4 sql

master
kanoi 10 years ago
parent
commit
14df8faf0d
  1. 5
      sql/ckdb.sql
  2. 22
      sql/v0.3-v0.4.sql

5
sql/ckdb.sql

@ -366,20 +366,19 @@ CREATE TABLE poolstats (
CREATE TABLE userstats (
poolinstance character varying(256) NOT NULL,
userid bigint NOT NULL,
workername character varying(256) NOT NULL,
elapsed bigint NOT NULL,
hashrate float NOT NULL,
hashrate5m float NOT NULL,
hashrate1hr float NOT NULL,
hashrate24hr float NOT NULL,
summarylevel char NOT NULL,
statsdate timestamp with time zone NOT NULL,
createdate timestamp with time zone NOT NULL,
createby character varying(64) DEFAULT ''::character varying NOT NULL,
createcode character varying(128) DEFAULT ''::character varying NOT NULL,
createinet character varying(128) DEFAULT ''::character varying NOT NULL,
PRIMARY KEY (poolinstance, userid, createdate)
PRIMARY KEY (userid, workername, summarylevel, statsdate)
);

22
sql/v0.3-v0.4.sql

@ -19,10 +19,22 @@ BEGIN
END $$;
ALTER TABLE ONLY userstats
ADD COLUMN summarylevel char DEFAULT ' ' NOT NULL;
ALTER TABLE ONLY userstats
ALTER COLUMN summarylevel DROP DEFAULT;
DROP TABLE userstats;
CREATE TABLE userstats (
userid bigint NOT NULL,
workername character varying(256) NOT NULL,
hashrate float NOT NULL,
hashrate5m float NOT NULL,
hashrate1hr float NOT NULL,
hashrate24hr float NOT NULL,
summarylevel char NOT NULL,
statsdate timestamp with time zone NOT NULL,
createdate timestamp with time zone NOT NULL,
createby character varying(64) DEFAULT ''::character varying NOT NULL,
createcode character varying(128) DEFAULT ''::character varying NOT NULL,
createinet character varying(128) DEFAULT ''::character varying NOT NULL,
PRIMARY KEY (userid, workername, summarylevel, statsdate)
);
END transaction;

Loading…
Cancel
Save