-
Notifications
You must be signed in to change notification settings - Fork 3
Changing Database
** WARNING: The task in this page is not maintained continuously and may contain obsolete information.
Kustvakt uses SQLite by default, that can be changed with another database, such as MySQL.
Copy jdbc.properties
from full/src/main/resources
to the full/
directory.
Do not change the filename.
cp full/src/main/resources/jdbc.properties full/
Remove or comment the properties for Sqlite.
Uncomment the setting for MySQL.
Customize the jdbc.url
, jdbc.username
and jdbc.password
values.
jdbc.database=mysql jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://[hostname]:[port]/[database-name]?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC jdbc.username=username jdbc.password=password jdbc.schemaPath=db/mysql, db/predefined
jdbc.schemaPath
is used for database migration using Flyway and it corresponds to Flyway locations option. By default, the paths are interpreted as classpaths. To point to external directories, use the prefix filesystem
, for instance filesystem:sql
.
The values of jdbc.schemaPath
may have been set to
include test data defined in full/src/main/resources/db/test
and some user roles defined in full/src/main/resources/db/predefined
. You can omit the test data by removing
db/test
.
You should git ignore
this file to prevent pushing database password to github.
Open full/src/main/resource/default-config.xml
.
Search for all occurrences of property name="dataSource"
, for instance in
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="flyway"> <property name="dataSource" ref="sqliteDataSource"/> </bean>
Change the ref
attribute in dataSource
property to refer to the Spring bean with id c3p0DataSource
for all occurrences.
<property name="dataSource" ref="c3p0DataSource" />
While running KustvaktServer
or Kustvakt-full-[version].jar
,
MySQL tables will be created from the SQL files in
full/src/main/resources/db/mysql
and other paths specified in
jdbc.schemaPath
.
- Importing Kustvakt to Eclipse
- Installing Lombok
- Setting annotation processors
- Setting test environment
- HTTP Basic Authentication
- OAuth2 authorization scopes
- OAuth2 authorization request
- OAuth2 token request
- OAuth2 token revocation
- OAuth2 client registration
- OAuth2 client info
- OAuth2 client deregistration
- OAuth2 client secret reset
- Plugin registration
- Plugin list (marketplace)
- Plugin installation
- Plugin uninstallation
- Installed plugin list
- VC creation and update
- VC deletion
- VC list
- VC info
- VC KoralQuery
- VC statistics
- VC statistics with KoralQuery