Skip to content

Commit

Permalink
postgres: change the default schema from public to alter_pangya
Browse files Browse the repository at this point in the history
  • Loading branch information
hex-agon committed Dec 27, 2023
1 parent 0f78130 commit b4e0ed7
Show file tree
Hide file tree
Showing 18 changed files with 261 additions and 225 deletions.
4 changes: 3 additions & 1 deletion database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM postgres:15

ENV POSTGRES_USER=alter_pangya
ENV POSTGRES_PASSWORD=alter_pangya
ENV POSTGRES_DB=alter_pangya
ENV POSTGRES_DB=alter_pangya

COPY database-setup.sql /docker-entrypoint-initdb.d/
2 changes: 2 additions & 0 deletions database/database-setup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE SCHEMA alter_pangya;
ALTER DATABASE alter_pangya SET SEARCH_PATH to alter_pangya;
Original file line number Diff line number Diff line change
Expand Up @@ -28,72 +28,72 @@ import work.fking.pangya.game.persistence.jooq.tables.PlayerStatistics
* This class is generated by jOOQ.
*/
@Suppress("UNCHECKED_CAST")
open class Public : SchemaImpl("public", DefaultCatalog.DEFAULT_CATALOG) {
open class AlterPangya : SchemaImpl("alter_pangya", DefaultCatalog.DEFAULT_CATALOG) {
public companion object {

/**
* The reference instance of <code>public</code>
* The reference instance of <code>alter_pangya</code>
*/
val PUBLIC: Public = Public()
val ALTER_PANGYA: AlterPangya = AlterPangya()
}

/**
* The table <code>public.account</code>.
* The table <code>alter_pangya.account</code>.
*/
val ACCOUNT: Account get() = Account.ACCOUNT

/**
* The table <code>public.achievement</code>.
* The table <code>alter_pangya.achievement</code>.
*/
val ACHIEVEMENT: Achievement get() = Achievement.ACHIEVEMENT

/**
* The table <code>public.achievement_milestone</code>.
* The table <code>alter_pangya.achievement_milestone</code>.
*/
val ACHIEVEMENT_MILESTONE: AchievementMilestone get() = AchievementMilestone.ACHIEVEMENT_MILESTONE

/**
* The table <code>public.flyway_schema_history</code>.
* The table <code>alter_pangya.flyway_schema_history</code>.
*/
val FLYWAY_SCHEMA_HISTORY: FlywaySchemaHistory get() = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY

/**
* The table <code>public.player_achievement</code>.
* The table <code>alter_pangya.player_achievement</code>.
*/
val PLAYER_ACHIEVEMENT: PlayerAchievement get() = PlayerAchievement.PLAYER_ACHIEVEMENT

/**
* The table <code>public.player_achievement_milestone</code>.
* The table <code>alter_pangya.player_achievement_milestone</code>.
*/
val PLAYER_ACHIEVEMENT_MILESTONE: PlayerAchievementMilestone get() = PlayerAchievementMilestone.PLAYER_ACHIEVEMENT_MILESTONE

/**
* The table <code>public.player_caddie</code>.
* The table <code>alter_pangya.player_caddie</code>.
*/
val PLAYER_CADDIE: PlayerCaddie get() = PlayerCaddie.PLAYER_CADDIE

/**
* The table <code>public.player_character</code>.
* The table <code>alter_pangya.player_character</code>.
*/
val PLAYER_CHARACTER: PlayerCharacter get() = PlayerCharacter.PLAYER_CHARACTER

/**
* The table <code>public.player_equipment</code>.
* The table <code>alter_pangya.player_equipment</code>.
*/
val PLAYER_EQUIPMENT: PlayerEquipment get() = PlayerEquipment.PLAYER_EQUIPMENT

/**
* The table <code>public.player_inventory_card</code>.
* The table <code>alter_pangya.player_inventory_card</code>.
*/
val PLAYER_INVENTORY_CARD: PlayerInventoryCard get() = PlayerInventoryCard.PLAYER_INVENTORY_CARD

/**
* The table <code>public.player_inventory_item</code>.
* The table <code>alter_pangya.player_inventory_item</code>.
*/
val PLAYER_INVENTORY_ITEM: PlayerInventoryItem get() = PlayerInventoryItem.PLAYER_INVENTORY_ITEM

/**
* The table <code>public.player_statistics</code>.
* The table <code>alter_pangya.player_statistics</code>.
*/
val PLAYER_STATISTICS: PlayerStatistics get() = PlayerStatistics.PLAYER_STATISTICS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ open class DefaultCatalog : CatalogImpl("") {
}

/**
* The schema <code>public</code>.
* The schema <code>alter_pangya</code>.
*/
val PUBLIC: Public get(): Public = Public.PUBLIC
val ALTER_PANGYA: AlterPangya get(): AlterPangya = AlterPangya.ALTER_PANGYA

override fun getSchemas(): List<Schema> = listOf(
Public.PUBLIC
AlterPangya.ALTER_PANGYA
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.jooq.impl.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

import work.fking.pangya.game.persistence.jooq.Public
import work.fking.pangya.game.persistence.jooq.AlterPangya
import work.fking.pangya.game.persistence.jooq.indexes.IDX__ACCOUNT_NICKNAME
import work.fking.pangya.game.persistence.jooq.indexes.IDX__ACCOUNT_USERNAME
import work.fking.pangya.game.persistence.jooq.indexes.IDX__ACCOUNT_UUID
Expand All @@ -48,7 +48,7 @@ open class Account(
parameters: Array<Field<*>?>?
): TableImpl<AccountRecord>(
alias,
Public.PUBLIC,
AlterPangya.ALTER_PANGYA,
child,
path,
aliased,
Expand All @@ -59,7 +59,7 @@ open class Account(
companion object {

/**
* The reference instance of <code>public.account</code>
* The reference instance of <code>alter_pangya.account</code>
*/
val ACCOUNT: Account = Account()
}
Expand All @@ -70,65 +70,65 @@ open class Account(
override fun getRecordType(): Class<AccountRecord> = AccountRecord::class.java

/**
* The column <code>public.account.uid</code>.
* The column <code>alter_pangya.account.uid</code>.
*/
val UID: TableField<AccountRecord, Int?> = createField(DSL.name("uid"), SQLDataType.INTEGER.nullable(false).identity(true), this, "")

/**
* The column <code>public.account.uuid</code>.
* The column <code>alter_pangya.account.uuid</code>.
*/
val UUID: TableField<AccountRecord, java.util.UUID?> = createField(DSL.name("uuid"), SQLDataType.UUID.nullable(false), this, "")

/**
* The column <code>public.account.username</code>.
* The column <code>alter_pangya.account.username</code>.
*/
val USERNAME: TableField<AccountRecord, String?> = createField(DSL.name("username"), SQLDataType.CLOB.nullable(false), this, "")

/**
* The column <code>public.account.nickname</code>.
* The column <code>alter_pangya.account.nickname</code>.
*/
val NICKNAME: TableField<AccountRecord, String?> = createField(DSL.name("nickname"), SQLDataType.CLOB, this, "")

/**
* The column <code>public.account.password</code>.
* The column <code>alter_pangya.account.password</code>.
*/
val PASSWORD: TableField<AccountRecord, ByteArray?> = createField(DSL.name("password"), SQLDataType.BLOB.nullable(false), this, "")

/**
* The column <code>public.account.pang_balance</code>.
* The column <code>alter_pangya.account.pang_balance</code>.
*/
val PANG_BALANCE: TableField<AccountRecord, Long?> = createField(DSL.name("pang_balance"), SQLDataType.BIGINT.nullable(false), this, "")

/**
* The column <code>public.account.cookie_balance</code>.
* The column <code>alter_pangya.account.cookie_balance</code>.
*/
val COOKIE_BALANCE: TableField<AccountRecord, Long?> = createField(DSL.name("cookie_balance"), SQLDataType.BIGINT.nullable(false), this, "")

/**
* The column <code>public.account.created_at</code>.
* The column <code>alter_pangya.account.created_at</code>.
*/
val CREATED_AT: TableField<AccountRecord, OffsetDateTime?> = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "")

private constructor(alias: Name, aliased: Table<AccountRecord>?): this(alias, null, null, aliased, null)
private constructor(alias: Name, aliased: Table<AccountRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)

/**
* Create an aliased <code>public.account</code> table reference
* Create an aliased <code>alter_pangya.account</code> table reference
*/
constructor(alias: String): this(DSL.name(alias))

/**
* Create an aliased <code>public.account</code> table reference
* Create an aliased <code>alter_pangya.account</code> table reference
*/
constructor(alias: Name): this(alias, null)

/**
* Create a <code>public.account</code> table reference
* Create a <code>alter_pangya.account</code> table reference
*/
constructor(): this(DSL.name("account"), null)

constructor(child: Table<out Record>, key: ForeignKey<out Record, AccountRecord>): this(Internal.createPathAlias(child, key), child, key, ACCOUNT, null)
override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
override fun getSchema(): Schema? = if (aliased()) null else AlterPangya.ALTER_PANGYA
override fun getIndexes(): List<Index> = listOf(IDX__ACCOUNT_NICKNAME, IDX__ACCOUNT_USERNAME, IDX__ACCOUNT_UUID)
override fun getIdentity(): Identity<AccountRecord, Int?> = super.getIdentity() as Identity<AccountRecord, Int?>
override fun getPrimaryKey(): UniqueKey<AccountRecord> = ACCOUNT_PKEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.jooq.impl.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

import work.fking.pangya.game.persistence.jooq.Public
import work.fking.pangya.game.persistence.jooq.AlterPangya
import work.fking.pangya.game.persistence.jooq.keys.ACHIEVEMENT_PKEY
import work.fking.pangya.game.persistence.jooq.tables.records.AchievementRecord

Expand All @@ -40,7 +40,7 @@ open class Achievement(
parameters: Array<Field<*>?>?
): TableImpl<AchievementRecord>(
alias,
Public.PUBLIC,
AlterPangya.ALTER_PANGYA,
child,
path,
aliased,
Expand All @@ -51,7 +51,7 @@ open class Achievement(
companion object {

/**
* The reference instance of <code>public.achievement</code>
* The reference instance of <code>alter_pangya.achievement</code>
*/
val ACHIEVEMENT: Achievement = Achievement()
}
Expand All @@ -62,40 +62,41 @@ open class Achievement(
override fun getRecordType(): Class<AchievementRecord> = AchievementRecord::class.java

/**
* The column <code>public.achievement.iff_id</code>.
* The column <code>alter_pangya.achievement.iff_id</code>.
*/
val IFF_ID: TableField<AchievementRecord, Int?> = createField(DSL.name("iff_id"), SQLDataType.INTEGER.nullable(false), this, "")

/**
* The column <code>public.achievement.completed_with_milestone</code>.
* The column
* <code>alter_pangya.achievement.completed_with_milestone</code>.
*/
val COMPLETED_WITH_MILESTONE: TableField<AchievementRecord, Int?> = createField(DSL.name("completed_with_milestone"), SQLDataType.INTEGER.nullable(false), this, "")

/**
* The column <code>public.achievement.category</code>.
* The column <code>alter_pangya.achievement.category</code>.
*/
val CATEGORY: TableField<AchievementRecord, Int?> = createField(DSL.name("category"), SQLDataType.INTEGER.nullable(false), this, "")

private constructor(alias: Name, aliased: Table<AchievementRecord>?): this(alias, null, null, aliased, null)
private constructor(alias: Name, aliased: Table<AchievementRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)

/**
* Create an aliased <code>public.achievement</code> table reference
* Create an aliased <code>alter_pangya.achievement</code> table reference
*/
constructor(alias: String): this(DSL.name(alias))

/**
* Create an aliased <code>public.achievement</code> table reference
* Create an aliased <code>alter_pangya.achievement</code> table reference
*/
constructor(alias: Name): this(alias, null)

/**
* Create a <code>public.achievement</code> table reference
* Create a <code>alter_pangya.achievement</code> table reference
*/
constructor(): this(DSL.name("achievement"), null)

constructor(child: Table<out Record>, key: ForeignKey<out Record, AchievementRecord>): this(Internal.createPathAlias(child, key), child, key, ACHIEVEMENT, null)
override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
override fun getSchema(): Schema? = if (aliased()) null else AlterPangya.ALTER_PANGYA
override fun getPrimaryKey(): UniqueKey<AchievementRecord> = ACHIEVEMENT_PKEY
override fun `as`(alias: String): Achievement = Achievement(DSL.name(alias), this)
override fun `as`(alias: Name): Achievement = Achievement(alias, this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.jooq.impl.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

import work.fking.pangya.game.persistence.jooq.Public
import work.fking.pangya.game.persistence.jooq.AlterPangya
import work.fking.pangya.game.persistence.jooq.keys.ACHIEVEMENT_MILESTONE_PKEY
import work.fking.pangya.game.persistence.jooq.keys.ACHIEVEMENT_MILESTONE__FK__ACHIEVEMENT_MILESTONE
import work.fking.pangya.game.persistence.jooq.tables.records.AchievementMilestoneRecord
Expand All @@ -43,7 +43,7 @@ open class AchievementMilestone(
parameters: Array<Field<*>?>?
): TableImpl<AchievementMilestoneRecord>(
alias,
Public.PUBLIC,
AlterPangya.ALTER_PANGYA,
child,
path,
aliased,
Expand All @@ -54,7 +54,8 @@ open class AchievementMilestone(
companion object {

/**
* The reference instance of <code>public.achievement_milestone</code>
* The reference instance of
* <code>alter_pangya.achievement_milestone</code>
*/
val ACHIEVEMENT_MILESTONE: AchievementMilestone = AchievementMilestone()
}
Expand All @@ -65,49 +66,51 @@ open class AchievementMilestone(
override fun getRecordType(): Class<AchievementMilestoneRecord> = AchievementMilestoneRecord::class.java

/**
* The column <code>public.achievement_milestone.iff_id</code>.
* The column <code>alter_pangya.achievement_milestone.iff_id</code>.
*/
val IFF_ID: TableField<AchievementMilestoneRecord, Int?> = createField(DSL.name("iff_id"), SQLDataType.INTEGER.nullable(false), this, "")

/**
* The column <code>public.achievement_milestone.achievement_iff_id</code>.
* The column
* <code>alter_pangya.achievement_milestone.achievement_iff_id</code>.
*/
val ACHIEVEMENT_IFF_ID: TableField<AchievementMilestoneRecord, Int?> = createField(DSL.name("achievement_iff_id"), SQLDataType.INTEGER.nullable(false), this, "")

/**
* The column <code>public.achievement_milestone.name</code>.
* The column <code>alter_pangya.achievement_milestone.name</code>.
*/
val NAME: TableField<AchievementMilestoneRecord, String?> = createField(DSL.name("name"), SQLDataType.CLOB.nullable(false), this, "")

private constructor(alias: Name, aliased: Table<AchievementMilestoneRecord>?): this(alias, null, null, aliased, null)
private constructor(alias: Name, aliased: Table<AchievementMilestoneRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)

/**
* Create an aliased <code>public.achievement_milestone</code> table
* Create an aliased <code>alter_pangya.achievement_milestone</code> table
* reference
*/
constructor(alias: String): this(DSL.name(alias))

/**
* Create an aliased <code>public.achievement_milestone</code> table
* Create an aliased <code>alter_pangya.achievement_milestone</code> table
* reference
*/
constructor(alias: Name): this(alias, null)

/**
* Create a <code>public.achievement_milestone</code> table reference
* Create a <code>alter_pangya.achievement_milestone</code> table reference
*/
constructor(): this(DSL.name("achievement_milestone"), null)

constructor(child: Table<out Record>, key: ForeignKey<out Record, AchievementMilestoneRecord>): this(Internal.createPathAlias(child, key), child, key, ACHIEVEMENT_MILESTONE, null)
override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
override fun getSchema(): Schema? = if (aliased()) null else AlterPangya.ALTER_PANGYA
override fun getPrimaryKey(): UniqueKey<AchievementMilestoneRecord> = ACHIEVEMENT_MILESTONE_PKEY
override fun getReferences(): List<ForeignKey<AchievementMilestoneRecord, *>> = listOf(ACHIEVEMENT_MILESTONE__FK__ACHIEVEMENT_MILESTONE)

private lateinit var _achievement: Achievement

/**
* Get the implicit join path to the <code>public.achievement</code> table.
* Get the implicit join path to the <code>alter_pangya.achievement</code>
* table.
*/
fun achievement(): Achievement {
if (!this::_achievement.isInitialized)
Expand Down
Loading

0 comments on commit b4e0ed7

Please sign in to comment.