私はopenshiftDIYアプリケーションにデプロイされたplay2.0.1アプリケーションに取り組んでいます。playが間違ったデータベースを進化させようとし続けるので、私はデータベースに問題を抱えています。私はmysqlデータベースを持っており、playはH2データベース進化スクリプトを作成します。スクリプトは次のとおりです。
彼が作成しようとしているもの
create table gif (
id bigint not null,
title varchar(255),
add_date timestamp,
gif_url varchar(255),
img_source varchar(5000),
web_id varchar(255),
found_on varchar(255),
thumbnail varchar(255),
version integer not null,
constraint pk_gif primary key (id))
;
create table task (
id bigint not null,
action varchar(255),
queue integer,
type varchar(255),
object_id bigint,
params varchar(255),
working_on boolean,
version integer not null,
constraint pk_task primary key (id))
;
create sequence gif_seq;
create sequence task_seq;
何を作成する必要があるか
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table gif (
id bigint auto_increment not null,
title varchar(255),
add_date datetime,
gif_url varchar(255),
img_source varchar(5000),
web_id varchar(255),
found_on varchar(255),
thumbnail varchar(255),
version integer not null,
constraint pk_gif primary key (id))
;
create table task (
id bigint auto_increment not null,
action varchar(255),
queue integer,
type varchar(255),
object_id bigint,
params varchar(255),
working_on tinyint(1) default 0,
version integer not null,
constraint pk_task primary key (id))
;
私のapplication.conf
# This is the main configuration file for the application running on openshift.
# ~~~~~
include "application"
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="TsLWj4[^1N<7lkdhfaiusjdpoifnsaodfEkyPDTO[dnh<7_R[j;cN0:lGK6Mm`0048C@3PK]4KR6HobL"
# Openshift database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://"${OPENSHIFT_DB_HOST}":"${OPENSHIFT_DB_PORT}/${OPENSHIFT_APP_NAME}
db.default.user=${OPENSHIFT_DB_USERNAME}
db.default.password=${OPENSHIFT_DB_PASSWORD}
#db.default.driver=org.h2.Driver
#db.default.url="jdbc:h2:mem:play"
#db.default.user=sa
#db.default.password=""
#
# You can expose this datasource via JNDI if needed (Useful for JPA)
# db.default.jndiName=DefaultDS
ebean.default= "models.*"
#Akka
akka.default-dispatcher.fork-join-executor.pool-size-max = 64
akka.actor.debug.receive = on
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
# Root logger:
logger.root=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
# openshift action_hooks scripts configuration
# ~~~~~
openshift.play.params="-DapplyEvolutions.default=true"
私はこのコードでそれを実行します:
ターゲット/開始\ -Dhttp.port = 8080 \ -Dhttp.address = $ {OPENSHIFT_INTERNAL_IP} \ -Dconfig.resource = openshift.conf