Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

376: Schema: Disallow NULL for the original_id, translation_set_id, and project_id fields #420

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion glotpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/

define( 'GP_VERSION', '2.1.0-rc.2' );
define( 'GP_DB_VERSION', '980' );
define( 'GP_DB_VERSION', '990' );
define( 'GP_ROUTING', true );
define( 'GP_PLUGIN_FILE', __FILE__ );
define( 'GP_PATH', __DIR__ . '/' );
Expand Down
8 changes: 4 additions & 4 deletions gp-includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function gp_schema_get() {
*/
$gp_schema['translations'] = "CREATE TABLE $wpdb->gp_translations (
id int(10) NOT NULL auto_increment,
original_id int(10) DEFAULT NULL,
translation_set_id int(10) DEFAULT NULL,
original_id int(10) NOT NULL,
translation_set_id int(10) NOT NULL,
translation_0 text NOT NULL,
translation_1 text DEFAULT NULL,
translation_2 text DEFAULT NULL,
Expand Down Expand Up @@ -87,7 +87,7 @@ function gp_schema_get() {
id int(10) NOT NULL auto_increment,
name varchar(255) NOT NULL,
slug varchar(255) NOT NULL,
project_id int(10) DEFAULT NULL,
project_id int(10) NOT NULL,
locale varchar(10) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY project_id_slug_locale (project_id,slug({$max_pid_slug_locale_key_length}),locale),
Expand Down Expand Up @@ -117,7 +117,7 @@ function gp_schema_get() {

$gp_schema['originals'] = "CREATE TABLE $wpdb->gp_originals (
id int(10) NOT NULL auto_increment,
project_id int(10) DEFAULT NULL,
project_id int(10) NOT NULL,
context varchar(255) DEFAULT NULL,
singular text NOT NULL,
plural text DEFAULT NULL,
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/lib/factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function __construct( $factory = null, $thing = null ) {
parent::__construct( $factory, $thing? $thing : new GP_Translation );
$this->default_generation_definitions = array(
'translation_0' => new GP_UnitTest_Generator_Sequence( 'Translation %s' ),
'original_id' => 0,
);
}

Expand Down