From 41eeb1a5f11531497ba197c44224630486058ea0 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 18 Aug 2020 15:22:07 -0700 Subject: [PATCH] Fixed mysql schema import. --- package.json | 2 +- sql/schema.mysql.sql | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2d38e033..8b57f6a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.4.0", + "version": "0.5.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/sql/schema.mysql.sql b/sql/schema.mysql.sql index 09bcebbc..bc9a1a4e 100644 --- a/sql/schema.mysql.sql +++ b/sql/schema.mysql.sql @@ -3,6 +3,7 @@ drop table if exists pageview; drop table if exists session; drop table if exists website; drop table if exists account; +drop function if exists date_trunc; create table account ( user_id int unsigned not null auto_increment primary key, @@ -75,7 +76,8 @@ create index event_created_at_idx on event(created_at); create index event_website_id_idx on event(website_id); create index event_session_id_idx on event(session_id); -drop function if exists date_trunc; +delimiter $$ + create function date_trunc( in_granularity enum('minute', 'hour', 'day', 'month', 'year'), in_datetime datetime(6) @@ -100,4 +102,6 @@ begin end if; end; +$$ + insert into account (username, password, is_admin) values ('admin', '$2a$10$jsVC1XMAIIQtL0On8twztOmAr20YTVcsd4.yJncKspEwsBkeq6VFW', true); \ No newline at end of file