Plugin Directory

Changeset 2424757


Ignore:
Timestamp:
11/24/2020 03:00:32 PM (5 years ago)
Author:
stephino
Message:

[code] Added "if not exists" condition to SQL Create statements

Location:
stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Buildings.php

    r2358167 r2424757  
    7373     */
    7474    public function getCreateStatement() {
    75         return "CREATE TABLE `$this` (
     75        return "CREATE TABLE IF NOT EXISTS `$this` (
    7676    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    7777    `" . self::COL_BUILDING_USER_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Cities.php

    r2415900 r2424757  
    150150     */
    151151    public function getCreateStatement() {
    152         return "CREATE TABLE `$this` (
     152        return "CREATE TABLE IF NOT EXISTS `$this` (
    153153    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    154154    `" . self::COL_CITY_CREATED . "` int(11) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Convoys.php

    r2358167 r2424757  
    134134     */
    135135    public function getCreateStatement() {
    136         return "CREATE TABLE `$this` (
     136        return "CREATE TABLE IF NOT EXISTS `$this` (
    137137    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    138138    `" . self::COL_CONVOY_FROM_USER_ID . "` bigint(20) UNSIGNED NOT NULL,
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Entities.php

    r2424637 r2424757  
    8080     */
    8181    public function getCreateStatement() {
    82         return "CREATE TABLE `$this` (
     82        return "CREATE TABLE IF NOT EXISTS `$this` (
    8383    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    8484    `" . self::COL_ENTITY_USER_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Islands.php

    r2358167 r2424757  
    6666     */
    6767    public function getCreateStatement() {
    68         return "CREATE TABLE `$this` (
     68        return "CREATE TABLE IF NOT EXISTS `$this` (
    6969    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    7070    `" . self::COL_ISLAND_NAME . "` varchar(128) NOT NULL,
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Messages.php

    r2424637 r2424757  
    102102     */
    103103    public function getCreateStatement() {
    104         return "CREATE TABLE `$this` (
     104        return "CREATE TABLE IF NOT EXISTS `$this` (
    105105    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    106106    `" . self::COL_MESSAGE_TO . "` bigint(20) UNSIGNED NOT NULL,
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/PtfPlays.php

    r2424637 r2424757  
    9494     */
    9595    public function getCreateStatement() {
    96         return "CREATE TABLE `$this` (
     96        return "CREATE TABLE IF NOT EXISTS `$this` (
    9797    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    9898    `" . self::COL_PTF_PLAY_PTF_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Ptfs.php

    r2424637 r2424757  
    148148     */
    149149    public function getCreateStatement() {
    150         return "CREATE TABLE `$this` (
     150        return "CREATE TABLE IF NOT EXISTS `$this` (
    151151    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    152152    `" . self::COL_PTF_USER_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Queues.php

    r2358167 r2424757  
    9898     */
    9999    public function getCreateStatement() {
    100         return "CREATE TABLE `$this` (
     100        return "CREATE TABLE IF NOT EXISTS `$this` (
    101101    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    102102    `" . self::COL_QUEUE_USER_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/ResearchFields.php

    r2358167 r2424757  
    5252     */
    5353    public function getCreateStatement() {
    54         return "CREATE TABLE `$this` (
     54        return "CREATE TABLE IF NOT EXISTS `$this` (
    5555    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    5656    `" . self::COL_RESEARCH_FIELD_USER_ID . "` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Statistics.php

    r2415900 r2424757  
    5252     */
    5353    public function getCreateStatement() {
    54         return "CREATE TABLE `$this` (
     54        return "CREATE TABLE IF NOT EXISTS `$this` (
    5555    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    5656    `" . self::COL_STAT_DATE . "` DATE NOT NULL,
  • stephino-rpg/trunk/lib/Stephino/Rpg/Db/Table/Users.php

    r2424637 r2424757  
    143143     */
    144144    public function getCreateStatement() {
    145         return "CREATE TABLE `$this` (
     145        return "CREATE TABLE IF NOT EXISTS `$this` (
    146146    `" . self::COL_ID . "` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    147147    `" . self::COL_USER_WP_ID . "` bigint(20) UNSIGNED,
Note: See TracChangeset for help on using the changeset viewer.