diff options
author | Vitaly Takmazov | 2018-02-24 08:54:50 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-02-24 08:54:50 +0300 |
commit | 643d0840b90384de1ea055e91f5d4c7ec503fe95 (patch) | |
tree | a296507276ed1b63fa0665bf54f414adc605d620 | |
parent | 21f5b034cffe99ceffcab4679d4ee26aa4c6b07c (diff) |
h2 schema updates
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java index f5ed724a..9195d398 100644 --- a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java +++ b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java @@ -20,7 +20,10 @@ package com.juick.configuration; import com.juick.service.search.SearchService; import org.apache.commons.dbcp2.BasicDataSource; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; @@ -117,6 +120,8 @@ public class DataConfiguration implements TransactionManagementConfigurer { "user_id int(10) unsigned NOT NULL," + "jnotify tinyint(1) NOT NULL DEFAULT 1," + "`repliesview` tinyint(1) NOT NULL DEFAULT '0'," + + "`subscr_notify` tinyint(1) NOT NULL DEFAULT '1'," + + "`recommendations` tinyint(1) NOT NULL DEFAULT '1'," + "subscr_active tinyint(1) NOT NULL DEFAULT 1)"); jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS subscr_users (" + "user_id int(10) unsigned NOT NULL," + @@ -241,6 +246,29 @@ public class DataConfiguration implements TransactionManagementConfigurer { " `cnt` smallint(5) unsigned NOT NULL DEFAULT '0'," + " PRIMARY KEY (`user_id`)" + ")"); + jdbcTemplate.execute("CREATE TABLE `auth` (" + + " `user_id` int(10) unsigned NOT NULL," + + " `protocol` enum('xmpp','email','sms') NOT NULL," + + " `account` char(64) NOT NULL," + + " `authcode` char(8) NOT NULL" + + ")"); + jdbcTemplate.execute("CREATE TABLE `mail` (" + + " `user_id` int(10) unsigned NOT NULL," + + " `hash` char(16) NOT NULL," + + " PRIMARY KEY (`user_id`)" + + ")"); + jdbcTemplate.execute("CREATE TABLE `usersinfo` (" + + " `user_id` int(10) unsigned NOT NULL," + + " `jid` char(32) DEFAULT NULL," + + " `fullname` char(32) DEFAULT NULL," + + " `country` char(32) DEFAULT NULL," + + " `url` char(64) DEFAULT NULL," + + " `gender` char(32) DEFAULT NULL," + + " `bday` char(10) DEFAULT NULL," + + " `descr` varchar(255) DEFAULT NULL," + + " PRIMARY KEY (`user_id`)" + + ")"); + jdbcTemplate.update("INSERT INTO users(nick,passw) VALUES (?,?)", "ugnich", "secret"); } return jdbcTemplate; } |