<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://zh-cn.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yeqing-</id>
	<title>Board Game Arena - 用户贡献 [zh-cn]</title>
	<link rel="self" type="application/atom+xml" href="https://zh-cn.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yeqing-"/>
	<link rel="alternate" type="text/html" href="https://zh-cn.doc.boardgamearena.com/%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E8%B4%A1%E7%8C%AE/Yeqing-"/>
	<updated>2026-10-17T02:35:17Z</updated>
	<subtitle>用户贡献</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://zh-cn.doc.boardgamearena.com/index.php?title=Game_database_model:_dbmodel.sql&amp;diff=195</id>
		<title>Game database model: dbmodel.sql</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.doc.boardgamearena.com/index.php?title=Game_database_model:_dbmodel.sql&amp;diff=195"/>
		<updated>2021-07-03T12:17:06Z</updated>

		<summary type="html">&lt;p&gt;Yeqing-：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
你在这个文件里指定游戏的database schema。&lt;br /&gt;
&lt;br /&gt;
这个文件包含了在创建你的游戏table时将会执行的SQL queries。&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;注意:&#039;&#039;&#039; 你不能在游戏中改变database schema。&lt;br /&gt;
&lt;br /&gt;
== Create your schema ==&lt;br /&gt;
&lt;br /&gt;
To build this file, we recommend you to build the tables you need with the PhpMyAdmin tool (see BGA user guide), and then to export them and to copy/paste the content inside this file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; you must not use for a column the same name as for the table, as the framework replay function relies on regexp substitution to save/restore a previous state in a clone table with another name.&lt;br /&gt;
&lt;br /&gt;
Example: Deck component, see [[Deck]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `card` (&lt;br /&gt;
  `card_id` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `card_type` varchar(16) NOT NULL,&lt;br /&gt;
  `card_type_arg` int(11) NOT NULL,&lt;br /&gt;
  `card_location` varchar(16) NOT NULL,&lt;br /&gt;
  `card_location_arg` int(11) NOT NULL,&lt;br /&gt;
  PRIMARY KEY (`card_id`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Euro Game. See details on database design for euro game at [[BGA_Studio_Cookbook#Database_for_The_euro_game]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `token` (&lt;br /&gt;
  `token_key` varchar(32) NOT NULL,&lt;br /&gt;
  `token_location` varchar(32) NOT NULL,&lt;br /&gt;
  `token_state` int(10),&lt;br /&gt;
  PRIMARY KEY (`token_key`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rules you should follow:&lt;br /&gt;
&lt;br /&gt;
* Do not overcomplicate, you dealing with games with 50-500 pieces!&lt;br /&gt;
** If you 5 tables for card game with 30 cards - it is overkill&lt;br /&gt;
* Database should only be storing dynamic data, all static data should be stored in material.php.inc&lt;br /&gt;
** Example: you have cards that have power, color, special abilities. In database you only need to store card type, all the other properties should not be there. Only exception - if it changes during the game.&lt;br /&gt;
* Columns should be permanent, independent of game data, i.e. location, type, position, row, etc&lt;br /&gt;
** Example: do not create columns like Counry1, Country2, Country3, ...&lt;br /&gt;
* Do not store translatable string in database, use integer number of &amp;quot;ident&amp;quot; to access properties&lt;br /&gt;
** I.e. card type should be &amp;quot;22&amp;quot; or &amp;quot;bob_cat&amp;quot;, instead of &amp;quot;Bob&#039;s cat&amp;quot;&lt;br /&gt;
* Create separate module in php to handle all database queries, do a lot of type checking to prevent SQL injections&lt;br /&gt;
&lt;br /&gt;
Example of method handling database query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Set token state&lt;br /&gt;
    function setTokenState($token_key, $state) {&lt;br /&gt;
        self::checkState($state); // ensure state is number&lt;br /&gt;
        self::checkKey($token_key); // ensure key is alphanum&lt;br /&gt;
        $sql = &amp;quot;UPDATE &amp;quot; . $this-&amp;gt;table;&lt;br /&gt;
        $sql .= &amp;quot; SET token_state=&#039;$state&#039;&amp;quot;;&lt;br /&gt;
        $sql .= &amp;quot; WHERE token_key=&#039;$token_key&#039;&amp;quot;; // don&#039;t need to escape anymore since we checked key before&lt;br /&gt;
        self::DbQuery($sql);&lt;br /&gt;
        return $state;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Default tables ==&lt;br /&gt;
&lt;br /&gt;
Important: by default, BGA creates 4 tables for your game: &#039;&#039;&#039;global&#039;&#039;&#039;, &#039;&#039;&#039;stats&#039;&#039;&#039;, &#039;&#039;&#039;gamelog&#039;&#039;&#039;, and &#039;&#039;&#039;player&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You &#039;must not modify&#039; the schemas of the &#039;&#039;&#039;global&#039;&#039;&#039;, &#039;&#039;&#039;stats&#039;&#039;&#039; or &#039;&#039;&#039;gamelog&#039;&#039;&#039; tables (and you must not access them directly with SQL queries in your PHP code).&lt;br /&gt;
&lt;br /&gt;
=== The &#039;&#039;&#039;player&#039;&#039;&#039; table ===&lt;br /&gt;
&lt;br /&gt;
You may add columns to the &#039;&#039;&#039;player&#039;&#039;&#039; table. This is very practical to add simple values associated with players.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ALTER TABLE `player` ADD `player_reserve_size` SMALLINT UNSIGNED NOT NULL DEFAULT &#039;7&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The commonly used columns of default &amp;quot;player&amp;quot; table are:&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_no&amp;lt;/strong&amp;gt;: the index of player in natural playing order (starting with 1)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_id&amp;lt;/strong&amp;gt; (int)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_name&amp;lt;/strong&amp;gt;: (note: it is better to access this date with getActivePlayerName() or loadPlayersBasicInfos() methods)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_score&amp;lt;/strong&amp;gt;: the current score of the player (displayed in the player panel). You must update this field to update player&#039;s scores.&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_score_aux&amp;lt;/strong&amp;gt;: the secondary score, used as a tie breaker. You must update this field according to tie breaking rules of the game (see also: [[Main_game_logic:_yourgamename.game.php#Manage_player_scores_and_Tie_breaker|Manage_player_scores_and_Tie_breaker]])&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_table_order&amp;lt;/strong&amp;gt;: gives an indication of the rank of the player by order of arrival in the lobby (starting with 1). It is not the same as player_no (which is the player order &amp;lt;u&amp;gt;within&amp;lt;/u&amp;gt; the game). player_table_order is useful for setting custom teams if desired in a game option (for instance, 1st-2nd vs 3rd-4th).&amp;lt;br/&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; player_table_order &#039;&#039;only exists during game initialization&#039;&#039; (in the &#039;&#039;&#039;setupNewGame&#039;&#039;&#039; function). It is not added as a column in the &#039;&#039;&#039;players&#039;&#039;&#039; Db table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&amp;lt;u&amp;gt;CAUTION:&amp;lt;/u&amp;gt;&amp;lt;/strong&amp;gt; &#039;&#039;&#039;player_table_order&#039;&#039;&#039; is not guaranteed to be equal to the rank of the player in the table. For example, in a 4-player game, if the table was full but the 3rd player leaves before the game starts, the 4th player becomes 3rd on this table &amp;lt;u&amp;gt;but&amp;lt;/u&amp;gt; their player_table_no is still equal to 4! If another player then joins, their player_table_no will then be 5...&amp;lt;br /&amp;gt;Thus, it is essential to normalize these values first in the game setup if you wish to use them to prevent bugs at game launch. For example, if the set of player_table_order are &amp;lt;player A&amp;gt;: 3, &amp;lt;player B&amp;gt;: 2, &amp;lt;player C&amp;gt;: 5, &amp;lt;player D&amp;gt;: 7, you see that you can&#039;t read that values as ranks directly, but you can still deduce that &amp;lt;player B&amp;gt; was 1st on the table, then &amp;lt;player A&amp;gt; then &amp;lt;player C&amp;gt; then &amp;lt;player D&amp;gt;&amp;amp;nbsp;&amp;amp;#128521;&lt;br /&gt;
&lt;br /&gt;
See [https://en.doc.boardgamearena.com/BGA_Studio_Cookbook#Assigning_Player_Order Assigning Player Order] in the &#039;&#039;&#039;BGA Studio Cookbook&#039;&#039;&#039; for an example.&lt;br /&gt;
&lt;br /&gt;
== CREATE TABLES ==&lt;br /&gt;
you can create tables, using engine InnoDB&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `hands` &lt;br /&gt;
(&lt;br /&gt;
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, &lt;br /&gt;
`player_id` TINYINT(1) NOT NULL,&lt;br /&gt;
`1` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`2` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`3` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`4` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`5` BOOL NOT NULL DEFAULT 1,		&lt;br /&gt;
`6` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`7` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
PRIMARY KEY (`id`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: if you put comments, you cannot do it in the same line as code.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
`3` BOOL NOT NULL DEFAULT 1, --  activated or not&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will also comment out `3` BOOL, and that code will not be executed.&lt;br /&gt;
&lt;br /&gt;
== PHP ==&lt;br /&gt;
Database initialization should be in function setupNewGame() in &#039;gamename.game.php&#039;.&lt;br /&gt;
&lt;br /&gt;
Database schema migration should be in function upgradeTableDb(), see below.&lt;br /&gt;
&lt;br /&gt;
Warning: all CREATE/ALTER tables and view should be in dbmodel.sql. Do not call this queries from php to avoid implicit commits https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html&lt;br /&gt;
which will cause issues. Only time you can do such queries from php is in upgradeTableDb method&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
== Errors Log ==&lt;br /&gt;
To trace Database creation check the logs that you can access in /admin/studio.&lt;br /&gt;
&lt;br /&gt;
== Post-release database modification ==&lt;br /&gt;
If you want to modify your database schema after the first release of your game in production, you should implement upgradeTableDb method, see [[Post-release phase#Updating the database schema|Updating the database schema after release]]&lt;/div&gt;</summary>
		<author><name>Yeqing-</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.doc.boardgamearena.com/index.php?title=Game_database_model:_dbmodel.sql&amp;diff=194</id>
		<title>Game database model: dbmodel.sql</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.doc.boardgamearena.com/index.php?title=Game_database_model:_dbmodel.sql&amp;diff=194"/>
		<updated>2021-07-03T12:13:30Z</updated>

		<summary type="html">&lt;p&gt;Yeqing-：​创建页面，内容为“{{Studio_Framework_Navigation}}  In this file you specify the database schema of your game.  This file contains SQL queries that will be executed during the creation…”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
In this file you specify the database schema of your game.&lt;br /&gt;
&lt;br /&gt;
This file contains SQL queries that will be executed during the creation of your game table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; you can&#039;t change the database schema during the game.&lt;br /&gt;
&lt;br /&gt;
== Create your schema ==&lt;br /&gt;
&lt;br /&gt;
To build this file, we recommend you to build the tables you need with the PhpMyAdmin tool (see BGA user guide), and then to export them and to copy/paste the content inside this file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; you must not use for a column the same name as for the table, as the framework replay function relies on regexp substitution to save/restore a previous state in a clone table with another name.&lt;br /&gt;
&lt;br /&gt;
Example: Deck component, see [[Deck]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `card` (&lt;br /&gt;
  `card_id` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `card_type` varchar(16) NOT NULL,&lt;br /&gt;
  `card_type_arg` int(11) NOT NULL,&lt;br /&gt;
  `card_location` varchar(16) NOT NULL,&lt;br /&gt;
  `card_location_arg` int(11) NOT NULL,&lt;br /&gt;
  PRIMARY KEY (`card_id`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Euro Game. See details on database design for euro game at [[BGA_Studio_Cookbook#Database_for_The_euro_game]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `token` (&lt;br /&gt;
  `token_key` varchar(32) NOT NULL,&lt;br /&gt;
  `token_location` varchar(32) NOT NULL,&lt;br /&gt;
  `token_state` int(10),&lt;br /&gt;
  PRIMARY KEY (`token_key`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rules you should follow:&lt;br /&gt;
&lt;br /&gt;
* Do not overcomplicate, you dealing with games with 50-500 pieces!&lt;br /&gt;
** If you 5 tables for card game with 30 cards - it is overkill&lt;br /&gt;
* Database should only be storing dynamic data, all static data should be stored in material.php.inc&lt;br /&gt;
** Example: you have cards that have power, color, special abilities. In database you only need to store card type, all the other properties should not be there. Only exception - if it changes during the game.&lt;br /&gt;
* Columns should be permanent, independent of game data, i.e. location, type, position, row, etc&lt;br /&gt;
** Example: do not create columns like Counry1, Country2, Country3, ...&lt;br /&gt;
* Do not store translatable string in database, use integer number of &amp;quot;ident&amp;quot; to access properties&lt;br /&gt;
** I.e. card type should be &amp;quot;22&amp;quot; or &amp;quot;bob_cat&amp;quot;, instead of &amp;quot;Bob&#039;s cat&amp;quot;&lt;br /&gt;
* Create separate module in php to handle all database queries, do a lot of type checking to prevent SQL injections&lt;br /&gt;
&lt;br /&gt;
Example of method handling database query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Set token state&lt;br /&gt;
    function setTokenState($token_key, $state) {&lt;br /&gt;
        self::checkState($state); // ensure state is number&lt;br /&gt;
        self::checkKey($token_key); // ensure key is alphanum&lt;br /&gt;
        $sql = &amp;quot;UPDATE &amp;quot; . $this-&amp;gt;table;&lt;br /&gt;
        $sql .= &amp;quot; SET token_state=&#039;$state&#039;&amp;quot;;&lt;br /&gt;
        $sql .= &amp;quot; WHERE token_key=&#039;$token_key&#039;&amp;quot;; // don&#039;t need to escape anymore since we checked key before&lt;br /&gt;
        self::DbQuery($sql);&lt;br /&gt;
        return $state;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Default tables ==&lt;br /&gt;
&lt;br /&gt;
Important: by default, BGA creates 4 tables for your game: &#039;&#039;&#039;global&#039;&#039;&#039;, &#039;&#039;&#039;stats&#039;&#039;&#039;, &#039;&#039;&#039;gamelog&#039;&#039;&#039;, and &#039;&#039;&#039;player&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You &#039;must not modify&#039; the schemas of the &#039;&#039;&#039;global&#039;&#039;&#039;, &#039;&#039;&#039;stats&#039;&#039;&#039; or &#039;&#039;&#039;gamelog&#039;&#039;&#039; tables (and you must not access them directly with SQL queries in your PHP code).&lt;br /&gt;
&lt;br /&gt;
=== The &#039;&#039;&#039;player&#039;&#039;&#039; table ===&lt;br /&gt;
&lt;br /&gt;
You may add columns to the &#039;&#039;&#039;player&#039;&#039;&#039; table. This is very practical to add simple values associated with players.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ALTER TABLE `player` ADD `player_reserve_size` SMALLINT UNSIGNED NOT NULL DEFAULT &#039;7&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The commonly used columns of default &amp;quot;player&amp;quot; table are:&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_no&amp;lt;/strong&amp;gt;: the index of player in natural playing order (starting with 1)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_id&amp;lt;/strong&amp;gt; (int)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_name&amp;lt;/strong&amp;gt;: (note: it is better to access this date with getActivePlayerName() or loadPlayersBasicInfos() methods)&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_score&amp;lt;/strong&amp;gt;: the current score of the player (displayed in the player panel). You must update this field to update player&#039;s scores.&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_score_aux&amp;lt;/strong&amp;gt;: the secondary score, used as a tie breaker. You must update this field according to tie breaking rules of the game (see also: [[Main_game_logic:_yourgamename.game.php#Manage_player_scores_and_Tie_breaker|Manage_player_scores_and_Tie_breaker]])&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;player_table_order&amp;lt;/strong&amp;gt;: gives an indication of the rank of the player by order of arrival in the lobby (starting with 1). It is not the same as player_no (which is the player order &amp;lt;u&amp;gt;within&amp;lt;/u&amp;gt; the game). player_table_order is useful for setting custom teams if desired in a game option (for instance, 1st-2nd vs 3rd-4th).&amp;lt;br/&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; player_table_order &#039;&#039;only exists during game initialization&#039;&#039; (in the &#039;&#039;&#039;setupNewGame&#039;&#039;&#039; function). It is not added as a column in the &#039;&#039;&#039;players&#039;&#039;&#039; Db table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&amp;lt;u&amp;gt;CAUTION:&amp;lt;/u&amp;gt;&amp;lt;/strong&amp;gt; &#039;&#039;&#039;player_table_order&#039;&#039;&#039; is not guaranteed to be equal to the rank of the player in the table. For example, in a 4-player game, if the table was full but the 3rd player leaves before the game starts, the 4th player becomes 3rd on this table &amp;lt;u&amp;gt;but&amp;lt;/u&amp;gt; their player_table_no is still equal to 4! If another player then joins, their player_table_no will then be 5...&amp;lt;br /&amp;gt;Thus, it is essential to normalize these values first in the game setup if you wish to use them to prevent bugs at game launch. For example, if the set of player_table_order are &amp;lt;player A&amp;gt;: 3, &amp;lt;player B&amp;gt;: 2, &amp;lt;player C&amp;gt;: 5, &amp;lt;player D&amp;gt;: 7, you see that you can&#039;t read that values as ranks directly, but you can still deduce that &amp;lt;player B&amp;gt; was 1st on the table, then &amp;lt;player A&amp;gt; then &amp;lt;player C&amp;gt; then &amp;lt;player D&amp;gt;&amp;amp;nbsp;&amp;amp;#128521;&lt;br /&gt;
&lt;br /&gt;
See [https://en.doc.boardgamearena.com/BGA_Studio_Cookbook#Assigning_Player_Order Assigning Player Order] in the &#039;&#039;&#039;BGA Studio Cookbook&#039;&#039;&#039; for an example.&lt;br /&gt;
&lt;br /&gt;
== CREATE TABLES ==&lt;br /&gt;
you can create tables, using engine InnoDB&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `hands` &lt;br /&gt;
(&lt;br /&gt;
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, &lt;br /&gt;
`player_id` TINYINT(1) NOT NULL,&lt;br /&gt;
`1` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`2` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`3` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`4` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`5` BOOL NOT NULL DEFAULT 1,		&lt;br /&gt;
`6` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
`7` BOOL NOT NULL DEFAULT 1,	&lt;br /&gt;
PRIMARY KEY (`id`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: if you put comments, you cannot do it in the same line as code.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
`3` BOOL NOT NULL DEFAULT 1, --  activated or not&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will also comment out `3` BOOL, and that code will not be executed.&lt;br /&gt;
&lt;br /&gt;
== PHP ==&lt;br /&gt;
Database initialization should be in function setupNewGame() in &#039;gamename.game.php&#039;.&lt;br /&gt;
&lt;br /&gt;
Database schema migration should be in function upgradeTableDb(), see below.&lt;br /&gt;
&lt;br /&gt;
Warning: all CREATE/ALTER tables and view should be in dbmodel.sql. Do not call this queries from php to avoid implicit commits https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html&lt;br /&gt;
which will cause issues. Only time you can do such queries from php is in upgradeTableDb method&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
== Errors Log ==&lt;br /&gt;
To trace Database creation check the logs that you can access in /admin/studio.&lt;br /&gt;
&lt;br /&gt;
== Post-release database modification ==&lt;br /&gt;
If you want to modify your database schema after the first release of your game in production, you should implement upgradeTableDb method, see [[Post-release phase#Updating the database schema|Updating the database schema after release]]&lt;/div&gt;</summary>
		<author><name>Yeqing-</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.doc.boardgamearena.com/index.php?title=Gamehelpabandonallartichokes&amp;diff=193</id>
		<title>Gamehelpabandonallartichokes</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.doc.boardgamearena.com/index.php?title=Gamehelpabandonallartichokes&amp;diff=193"/>
		<updated>2021-06-29T11:38:39Z</updated>

		<summary type="html">&lt;p&gt;Yeqing-：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;欢迎来到Abandon All Artichokes，这是一款快节奏、&amp;quot;破坏牌组&amp;quot;的卡牌游戏。收获蔬菜以建立你的卡组并获得新的能力，同时通过任何必要的手段丢弃洋蓟。如果你能在你的回合结束时手牌里没有洋蓟，你就赢得了游戏!&lt;br /&gt;
&lt;br /&gt;
Abandon All Artichokes的规则很简单：&lt;br /&gt;
&lt;br /&gt;
* 从花园行（游戏区顶部的牌堆）中抽取一张蔬菜牌到你的手中。&lt;br /&gt;
* 从你的手牌中打出零张或更多的蔬菜牌。你不能打洋蓟，但所有其他蔬菜牌都有某种效果。  &lt;br /&gt;
* 当你结束后，丢弃你的手牌，并从你的卡组中抽出5张新的牌--如果其中没有洋蓟，你就赢了！  &lt;br /&gt;
* 否则，就轮到下一个玩家了。  &lt;br /&gt;
* 在你的回合结束后，当你重新填充你的手牌时，如果没有任何一张牌是洋蓟，你就立即赢得了游戏！  &lt;br /&gt;
&lt;br /&gt;
重要提示：如果在你（或其他玩家）的回合中，你的手牌没有洋蓟，你不会赢。&lt;/div&gt;</summary>
		<author><name>Yeqing-</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.doc.boardgamearena.com/index.php?title=Gamehelpabandonallartichokes&amp;diff=192</id>
		<title>Gamehelpabandonallartichokes</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.doc.boardgamearena.com/index.php?title=Gamehelpabandonallartichokes&amp;diff=192"/>
		<updated>2021-06-29T11:36:58Z</updated>

		<summary type="html">&lt;p&gt;Yeqing-：​创建页面，内容为“欢迎来到Abandon All Artichokes，这是一款快节奏、&amp;quot;破坏牌组&amp;quot;的卡牌游戏。收获蔬菜以建立你的卡组并获得新的能力，同时通过任…”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;欢迎来到Abandon All Artichokes，这是一款快节奏、&amp;quot;破坏牌组&amp;quot;的卡牌游戏。收获蔬菜以建立你的卡组并获得新的能力，同时通过任何必要的手段丢弃洋蓟。如果你能在你的回合结束时手牌里没有洋蓟，你就赢得了游戏!&lt;br /&gt;
&lt;br /&gt;
Abandon All Artichokes的规则很简单：&lt;br /&gt;
&lt;br /&gt;
从花园行（游戏区顶部的牌堆）中抽取一张蔬菜牌到你的手中。&lt;br /&gt;
从你的手牌中打出零张或更多的蔬菜牌。你不能打洋蓟，但所有其他蔬菜牌都有某种效果。  &lt;br /&gt;
当你结束后，丢弃你的手牌，并从你的卡组中抽出5张新的牌--如果其中没有洋蓟，你就赢了！  &lt;br /&gt;
否则，就轮到下一个玩家了。  &lt;br /&gt;
在你的回合结束后，当你重新填充你的手牌时，如果没有任何一张牌是洋蓟，你就立即赢得了游戏！  &lt;br /&gt;
&lt;br /&gt;
重要提示：如果在你（或其他玩家）的回合中，你的手牌没有洋蓟，你不会赢。&lt;/div&gt;</summary>
		<author><name>Yeqing-</name></author>
	</entry>
</feed>