main
Paulo Gustavo Veiga 2024-02-17 00:14:09 -08:00
parent 83e080d677
commit aadb88451b
10 changed files with 48 additions and 71 deletions

View File

@ -1 +0,0 @@
# # Command: mysql -u root -p < apopulate_schemas.sql # INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); COMMIT;

View File

@ -0,0 +1,14 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/wisemapping?useUnicode=yes&characterEncoding=UTF-8
driver-class-name: com.mysql.cj.jdbc.Driver
password: password
username: wisemapping
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect
sql:
init:
platform: mysql

View File

@ -1 +0,0 @@
DROP TABLE IF EXISTS ACCESS_AUDITORY; DROP TABLE IF EXISTS COLLABORATION; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS MINDMAP_HISTORY; DROP TABLE IF EXISTS LABEL; DROP TABLE IF EXISTS MINDMAP; DROP TABLE IF EXISTS R_LABEL_MINDMAP DROP TABLE IF EXISTS USER; DROP TABLE IF EXISTS COLLABORATOR; COMMIT;

View File

@ -1,4 +1,7 @@
CREATE DATABASE wisemapping;
CREATE USER wisemapping WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO wisemapping;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO wisemapping;

View File

@ -1,10 +0,0 @@
DROP TABLE IF EXISTS ACCESS_AUDITORY;
DROP TABLE IF EXISTS COLLABORATION;
DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
DROP TABLE IF EXISTS MINDMAP_HISTORY;
DROP TABLE IF EXISTS R_LABEL_MINDMAP;
DROP TABLE IF EXISTS "LABEL";
DROP TABLE IF EXISTS MINDMAP;
DROP TABLE IF EXISTS "USER";
DROP TABLE IF EXISTS COLLABORATOR;
COMMIT;

View File

@ -1,4 +0,0 @@
# Compilation and Execution
Your will find all the steps and required documentation here: http://www.wisemapping.org/downloads/source

View File

@ -1,9 +0,0 @@
services:
database:
image: 'postgres:15.2'
ports:
- '5432'
environment:
- 'POSTGRES_USER=myuser'
- 'POSTGRES_DB=mydatabase'
- 'POSTGRES_PASSWORD=secret'

View File

@ -0,0 +1 @@
INSERT IGNORE INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); INSERT IGNORE INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); INSERT IGNORE INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); INSERT IGNORE INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D');

View File

@ -83,10 +83,4 @@ CREATE TABLE ACCESS_AUDITORY (
login_date DATE,
user_id INTEGER NOT NULL,
FOREIGN KEY (user_id) REFERENCES "USER" (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
);
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO wisemapping;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO wisemapping;
COMMIT;
);

View File

@ -1,29 +1,22 @@
#
# Command: mysql -u root -p < create-schemas.sql
#
USE wisemapping;
CREATE TABLE COLLABORATOR (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255)
CHARACTER SET utf8 NOT NULL UNIQUE,
CREATE TABLE IF NOT EXISTS COLLABORATOR (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) CHARACTER SET UTF8MB4 NOT NULL UNIQUE,
creation_date DATE
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE USER (
CREATE TABLE IF NOT EXISTS USER (
colaborator_id INTEGER NOT NULL PRIMARY KEY,
authentication_type CHAR(1)
CHARACTER SET utf8 NOT NULL,
CHARACTER SET UTF8MB4 NOT NULL,
authenticator_uri VARCHAR(255)
CHARACTER SET utf8,
firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
password VARCHAR(255) CHARACTER SET utf8 NOT NULL,
firstname VARCHAR(255) CHARACTER SET UTF8MB4 NOT NULL,
lastname VARCHAR(255) CHARACTER SET UTF8MB4 NOT NULL,
password VARCHAR(255) CHARACTER SET UTF8MB4 NOT NULL,
activation_code BIGINT(20) NOT NULL,
activation_date DATE,
allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0,
allow_send_email CHAR(1) CHARACTER SET UTF8MB4 NOT NULL DEFAULT 0,
locale VARCHAR(5),
google_sync BOOL,
sync_code VARCHAR(255),
@ -31,15 +24,14 @@ CREATE TABLE USER (
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
) CHARACTER SET UTF8MB4;
CREATE TABLE MINDMAP (
CREATE TABLE IF NOT EXISTS MINDMAP (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(255)
CHARACTER SET utf8 NOT NULL,
CHARACTER SET UTF8MB4 NOT NULL,
description VARCHAR(255)
CHARACTER SET utf8 NOT NULL,
CHARACTER SET utf8,
xml MEDIUMBLOB NOT NULL,
public BOOL NOT NULL DEFAULT 0,
creation_date DATETIME,
@ -50,12 +42,12 @@ CREATE TABLE MINDMAP (
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE LABEL (
CREATE TABLE IF NOT EXISTS LABEL (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(30)
CHARACTER SET utf8 NOT NULL,
CHARACTER SET UTF8MB4 NOT NULL,
creator_id INTEGER NOT NULL,
parent_label_id INTEGER,
color VARCHAR(7) NOT NULL,
@ -64,9 +56,9 @@ CREATE TABLE LABEL (
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE R_LABEL_MINDMAP (
CREATE TABLE IF NOT EXISTS R_LABEL_MINDMAP (
mindmap_id INTEGER NOT NULL,
label_id INTEGER NOT NULL,
PRIMARY KEY (mindmap_id, label_id),
@ -75,9 +67,9 @@ CREATE TABLE R_LABEL_MINDMAP (
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE MINDMAP_HISTORY
CREATE TABLE IF NOT EXISTS MINDMAP_HISTORY
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
xml MEDIUMBLOB NOT NULL,
mindmap_id INTEGER NOT NULL,
@ -87,17 +79,17 @@ CREATE TABLE MINDMAP_HISTORY
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE COLLABORATION_PROPERTIES (
CREATE TABLE IF NOT EXISTS COLLABORATION_PROPERTIES (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
starred BOOL NOT NULL DEFAULT 0,
mindmap_properties VARCHAR(512)
CHARACTER SET utf8
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE COLLABORATION (
CREATE TABLE IF NOT EXISTS COLLABORATION (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
colaborator_id INTEGER NOT NULL,
properties_id INTEGER NOT NULL,
@ -112,9 +104,9 @@ CREATE TABLE COLLABORATION (
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CHARACTER SET UTF8MB4;
CREATE TABLE ACCESS_AUDITORY (
CREATE TABLE IF NOT EXISTS ACCESS_AUDITORY (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
login_date DATE,
user_id INTEGER NOT NULL,
@ -122,6 +114,4 @@ CREATE TABLE ACCESS_AUDITORY (
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
COMMIT;
CHARACTER SET UTF8MB4;