Skip to content
Snippets Groups Projects
Commit 73f84a39 authored by Félix  Sidokhine's avatar Félix Sidokhine Committed by Adrien Béraud
Browse files

Replaced in-code inits with Flyaway Migrations

Change-Id: I382ea5cad8e296e8406079746d46f904f7be68a4
parent 1a07527e
No related branches found
No related tags found
No related merge requests found
Showing
with 221 additions and 293 deletions
......@@ -23,10 +23,9 @@
<version>${debry.version}</version>
</dependency>
<dependency>
<groupId>net.jami</groupId>
<artifactId>jams-common</artifactId>
<version>${revision}</version>
<scope>compile</scope>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
</dependencies>
......
......@@ -36,24 +36,8 @@ import java.util.List;
public class ContactDao extends AbstractDao<Contact> {
public ContactDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("contacts");
this.setTClass(Contact.class);
String createTable = "CREATE TABLE contacts (" +
"owner varchar(255), " +
"uri varchar(255)," +
"displayName varchar(255)," +
"`timestamp` bigint," +
"status int," +
"PRIMARY KEY (owner,uri))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
} catch (SQLException e) {
log.error("Could not create the contacts table with error " + e.getMessage());
} finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("contacts");
this.setTClass(Contact.class);
}
//Not used because the strategy here is different.
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.jami.datastore.dao;
import lombok.extern.slf4j.Slf4j;
......@@ -35,44 +36,24 @@ import java.sql.SQLException;
public class DeviceDao extends AbstractDao<Device> {
public DeviceDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("devices");
this.setTClass(Device.class);
String createTable = "CREATE TABLE devices (" +
"deviceId varchar(255), " +
"owner varchar(255)," +
"displayName varchar(255)," +
"certificate varchar(5000), "+
"privatekey varchar(5000)," +
"PRIMARY KEY (deviceId))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
}
catch (SQLException e){
log.error("Could not create the device table with error " + e.getMessage());
}
finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("devices");
this.setTClass(Device.class);
}
@Override
public boolean storeObject(Device object) {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("INSERT INTO devices " +
"(deviceId, owner, displayName, certificate, privatekey) " +
"VALUES " +
"(?, ?, ?, ?, ?)");
"(deviceId, owner, displayName, certificate, privatekey) " +
"VALUES " +
"(?, ?, ?, ?, ?)");
ps = object.getInsert(ps);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to store a user: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......@@ -85,18 +66,16 @@ public class DeviceDao extends AbstractDao<Device> {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("UPDATE devices SET displayName = ? WHERE owner = ? AND deviceId = ?");
ps.setString(1, deviceName);
ps.setString(2, user);
ps.setString(3, deviceId);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to update a user: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.jami.datastore.dao;
import com.nimbusds.jwt.SignedJWT;
......@@ -35,44 +36,26 @@ import java.util.List;
@Slf4j
public class JwtDao extends AbstractDao<SignedJWT> {
private static final String SQL_STORE_TOKEN = "INSERT INTO tokens (userid,deviceId,token) VALUES (?,?,?)";
private static final String SQL_STORE_TOKEN = "INSERT INTO tokens (userid,deviceId,token) VALUES (?,?,?)";
private static final String SQL_DELETE_TOKEN = "DELETE FROM tokens WHERE userid = ? AND deviceId = ?";
private static final String SQL_GET_TOKEN = "SELECT COUNT(token) FROM tokens WHERE token = ?";
private static final String SQL_GET_TOKEN = "SELECT COUNT(token) FROM tokens WHERE token = ?";
public JwtDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("tokens");
this.setTClass(SignedJWT.class);
String createTable = "CREATE TABLE tokens (" +
"userid varchar(255), " +
"deviceId varchar(255)," +
"token varchar(255)," +
"PRIMARY KEY (userid, deviceId))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
}
catch (SQLException e){
log.error("Could not create the device table with error " + e.getMessage());
}
finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("tokens");
this.setTClass(SignedJWT.class);
}
@Override
public boolean storeObject(SignedJWT object) {
//TODO: Implement this.
return true;
}
public boolean validateToken(SignedJWT signedJWT){
public boolean validateToken(SignedJWT signedJWT) {
//TODO: Implement this.
return true;
}
//This method is not needed because we are only concerned with the existence of a token,
//we never actually look them up.
@Override
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.jami.datastore.dao;
import lombok.extern.slf4j.Slf4j;
......@@ -35,42 +36,24 @@ import java.sql.SQLException;
public class SystemDao extends AbstractDao<SystemAccount> {
public SystemDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("system");
this.setTClass(SystemAccount.class);
String createTable = "CREATE TABLE "+ this.getTableName() + " (" +
"entity varchar(255), " +
"certificate varchar(5000), "+
"privatekey varchar(5000)," +
"PRIMARY KEY (entity))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
}
catch (SQLException e){
log.error("Could not create the device table with error " + e.getMessage());
}
finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("system");
this.setTClass(SystemAccount.class);
}
@Override
public boolean storeObject(SystemAccount object) {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("INSERT INTO system " +
"(entity,certificate,privatekey)" +
"VALUES " +
"(?, ?, ?)");
"(entity,certificate,privatekey)" +
"VALUES " +
"(?, ?, ?)");
ps = object.getInsert(ps);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to store a system entity: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.jami.datastore.dao;
import lombok.extern.slf4j.Slf4j;
......@@ -35,51 +36,25 @@ import java.sql.SQLException;
public class UserDao extends AbstractDao<User> {
public UserDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("users");
this.setTClass(User.class);
String createTable = "CREATE TABLE users (" +
"username varchar(255), " +
"password varchar(255)," +
"userType varchar(10)," +
"realm varchar(255)," +
"ethAddress varchar(255)," +
"ethKey varchar(255)," +
"jamiId varchar(255)," +
"certificate varchar(5000), "+
"privatekey varchar(5000)," +
"accessLevel varchar(10),"+
"needsPasswordReset varchar(10),"+
"PRIMARY KEY (username))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
}
catch (SQLException e){
log.error("Could not create the device table with error " + e.getMessage());
}
finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("users");
this.setTClass(User.class);
}
@Override
public boolean storeObject(User object) {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("INSERT INTO users " +
"(username, password, userType, realm, ethAddress, ethKey, jamiId,certificate, privatekey, accessLevel," +
"needsPasswordReset) " +
"VALUES " +
"(?, ?, ?, ?, ?, ?, ?,?, ?,?, ?)");
"(username, password, userType, realm, ethAddress, ethKey, jamiId,certificate, privatekey, accessLevel," +
"needsPasswordReset) " +
"VALUES " +
"(?, ?, ?, ?, ?, ?, ?,?, ?,?, ?)");
ps = object.getInsert(ps);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to store a user: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......@@ -91,12 +66,13 @@ public class UserDao extends AbstractDao<User> {
String user = constraints.getStatements().get(0).getValue();
String pwReset = "false";
if (update.getStatements().size() > 1)
if (update.getStatements().size() > 1) {
pwReset = update.getStatements().get(1).getValue();
}
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("UPDATE users SET password = ? WHERE username = ?");
ps.setString(1, pw);
ps.setString(2, user);
......@@ -107,12 +83,10 @@ public class UserDao extends AbstractDao<User> {
ps.setString(2, user);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to update a user: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.jami.datastore.dao;
import lombok.extern.slf4j.Slf4j;
......@@ -37,73 +38,43 @@ public class UserProfileDao extends AbstractDao<UserProfile> {
//Fis this to include the fields from AD/LDAP.
public UserProfileDao() {
SQLConnection connection = DataStore.connectionPool.getConnection();
try {
this.setTableName("local_directory");
this.setTClass(UserProfile.class);
String createTable = "CREATE TABLE local_directory (" +
"username varchar(255), " +
"firstName varchar(255), " +
"lastName varchar(255), " +
"email varchar(255), " +
"profilePicture CLOB, " +
"organization varchar(255), " +
"phoneNumber varchar(255), " +
"phoneNumberExtension varchar(255), " +
"faxNumber varchar(255), " +
"mobileNumber varchar(255), " +
"PRIMARY KEY (username))";
PreparedStatement ps = connection.getConnection().prepareStatement(createTable);
ps.execute();
}
catch (SQLException e){
log.error("Could not create the user profile table with error " + e.getMessage());
}
finally {
DataStore.connectionPool.returnConnection(connection);
}
this.setTableName("local_directory");
this.setTClass(UserProfile.class);
}
@Override
public boolean storeObject(UserProfile object) {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("INSERT INTO local_directory " +
"(username, firstName, lastName, email, profilePicture, organization, phoneNumber, phoneNumberExtension, faxNumber, mobileNumber)" +
" VALUES " + "(?,?,?,?,?,?,?,?,?,?)");
"(username, firstName, lastName, email, profilePicture, organization, phoneNumber, phoneNumberExtension, faxNumber, mobileNumber)" +
" VALUES " + "(?,?,?,?,?,?,?,?,?,?)");
ps = object.getInsert(ps);
return ps.executeUpdate() != 0;
}
catch (Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to store a user profile: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
@Override
public boolean updateObject(StatementList update, StatementList constraints){
public boolean updateObject(StatementList update, StatementList constraints) {
SQLConnection connection = DataStore.connectionPool.getConnection();
try{
try {
PreparedStatement ps = connection.getConnection().prepareStatement("UPDATE local_directory SET firstname = ?, lastName = ?, email = ?, profilePicture = ?, organization = ?, phoneNumber = ?, phoneNumberExtension = ?, faxNumber = ?, mobileNumber = ? WHERE username = ?");
for(int i=1;i<update.getStatements().size();i++){
for (int i = 1; i < update.getStatements().size(); i++) {
ps.setString(i, update.getStatements().get(i).getValue());
}
ps.setString(update.getStatements().size(), update.getStatements().get(0).getValue());
return ps.executeUpdate() != 0;
}
catch(Exception e){
} catch (Exception e) {
log.error("An error has occurred while trying to update a user profile: " + e.toString());
return false;
}
finally {
} finally {
DataStore.connectionPool.returnConnection(connection);
}
}
......
......@@ -38,6 +38,7 @@ import net.jami.jams.common.dao.StatementList;
import net.jami.jams.common.dao.connectivity.ConnectionPool;
import net.jami.jams.common.objects.user.User;
import net.jami.jams.common.objects.user.UserProfile;
import org.flywaydb.core.Flyway;
import java.util.List;
......@@ -55,6 +56,8 @@ public class DataStore implements AuthenticationSource {
//Implicitly connect to derby.
public DataStore(String connectionString) {
Flyway flyway = Flyway.configure().dataSource(connectionString,"", "").load();
flyway.migrate();
connectionPool = new ConnectionPool(connectionString);
userDao = new UserDao();
deviceDao = new DeviceDao();
......
CREATE TABLE contacts (owner varchar(255),
uri varchar(255), displayName varchar(255) ,
timestamp bigint, status int,
PRIMARY KEY (owner,uri));
\ No newline at end of file
CREATE TABLE devices (deviceId varchar(255),
owner varchar(255), displayName varchar(255),
certificate varchar(5000), privatekey varchar(5000),
PRIMARY KEY (deviceId));
\ No newline at end of file
CREATE TABLE system (entity varchar(255),
certificate varchar(5000), privatekey varchar(5000),
PRIMARY KEY (entity));
\ No newline at end of file
CREATE TABLE users ( username varchar(255),
password varchar(255),userType varchar(10),
realm varchar(255),ethAddress varchar(255),
ethKey varchar(255),jamiId varchar(255),
certificate varchar(5000),privatekey varchar(5000),
accessLevel varchar(10),needsPasswordReset varchar(10),
PRIMARY KEY (username));
\ No newline at end of file
CREATE TABLE local_directory ( username varchar(255),
firstName varchar(255),lastName varchar(255),
email varchar(255),profilePicture CLOB,
organization varchar(255),phoneNumber varchar(255),
phoneNumberExtension varchar(255),
faxNumber varchar(255),mobileNumber varchar(255),
PRIMARY KEY (username));
\ No newline at end of file
......@@ -30,6 +30,7 @@ import net.jami.jams.common.objects.devices.Device;
import net.jami.jams.common.objects.user.AccessLevel;
import net.jami.jams.common.objects.user.User;
import net.jami.jams.common.utils.X509Utils;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
......
CREATE TABLE contacts (owner varchar(255),
uri varchar(255), displayName varchar(255) ,
timestamp bigint, status int,
PRIMARY KEY (owner,uri));
\ No newline at end of file
CREATE TABLE devices (deviceId varchar(255),
owner varchar(255), displayName varchar(255),
certificate varchar(5000), privatekey varchar(5000),
PRIMARY KEY (deviceId));
\ No newline at end of file
CREATE TABLE system (entity varchar(255),
certificate varchar(5000), privatekey varchar(5000),
PRIMARY KEY (entity));
\ No newline at end of file
CREATE TABLE users ( username varchar(255),
password varchar(255),userType varchar(10),
realm varchar(255),ethAddress varchar(255),
ethKey varchar(255),jamiId varchar(255),
certificate varchar(5000),privatekey varchar(5000),
accessLevel varchar(10),needsPasswordReset varchar(10),
PRIMARY KEY (username));
\ No newline at end of file
CREATE TABLE local_directory ( username varchar(255),
firstName varchar(255),lastName varchar(255),
email varchar(255),profilePicture CLOB,
organization varchar(255),phoneNumber varchar(255),
phoneNumberExtension varchar(255),
faxNumber varchar(255),mobileNumber varchar(255),
PRIMARY KEY (username));
\ No newline at end of file
......@@ -39,7 +39,7 @@
<junit.surefire.version>1.1.0</junit.surefire.version>
<jsoniter.version>0.9.23</jsoniter.version>
<javassist.version>3.27.0-GA</javassist.version>
<debry.version>10.11.1.1</debry.version>
<debry.version>10.14.2.0</debry.version>
<msgpack.version>0.8.16</msgpack.version>
<commons.codec.version>1.11</commons.codec.version>
<xbean.version>4.17</xbean.version>
......@@ -58,6 +58,7 @@
<embedded.ldap.unit>0.8.1</embedded.ldap.unit>
<maven.exec.version>1.1.1</maven.exec.version>
<zmq.version>0.5.2</zmq.version>
<flyway.version>6.5.1</flyway.version>
</properties>
<dependencies>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment