Add copyright
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package com.devsoap.dbt.demo
|
||||
|
||||
import org.flywaydb.core.Flyway
|
||||
import ratpack.service.Service
|
||||
import ratpack.service.StartEvent
|
||||
|
||||
import javax.sql.DataSource
|
||||
|
||||
class DatabaseService implements Service {
|
||||
|
||||
@Override
|
||||
void onStart(StartEvent event){
|
||||
new Flyway(dataSource: event.registry.get(DataSource)).migrate()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2018 Devsoap Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.devsoap.dbt.demo
|
||||
|
||||
import org.flywaydb.core.Flyway
|
||||
import ratpack.service.Service
|
||||
import ratpack.service.StartEvent
|
||||
|
||||
import javax.sql.DataSource
|
||||
|
||||
class FlywayMigrationService implements Service {
|
||||
|
||||
@Override
|
||||
void onStart(StartEvent event){
|
||||
new Flyway(dataSource: event.registry.get(DataSource)).migrate()
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,25 @@
|
||||
/*
|
||||
* Copyright 2018 Devsoap Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import com.devsoap.dbt.DBTModule
|
||||
import com.devsoap.dbt.demo.FlywayMigrationService
|
||||
import com.devsoap.dbt.services.TransactionManagerService
|
||||
import org.flywaydb.core.Flyway
|
||||
import org.h2.jdbcx.JdbcDataSource
|
||||
import ratpack.form.Form
|
||||
import ratpack.handlebars.HandlebarsModule
|
||||
import ratpack.http.Status
|
||||
import ratpack.service.Service
|
||||
|
||||
import javax.sql.DataSource
|
||||
|
||||
@@ -43,7 +57,7 @@ ratpack {
|
||||
/*
|
||||
* Migrate Flyway migrations at application start
|
||||
*/
|
||||
bindInstance { event -> new Flyway(dataSource: event.registry.get(DataSource)).migrate() } as Service
|
||||
bind FlywayMigrationService
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user