aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/downgrade_0052---0051.sql5
-rw-r--r--db/schema.sql10
-rw-r--r--db/schema_0052-translation-table.sql13
-rw-r--r--perllib/FixMyStreet/DB/Result/Translation.pm44
4 files changed, 72 insertions, 0 deletions
diff --git a/db/downgrade_0052---0051.sql b/db/downgrade_0052---0051.sql
new file mode 100644
index 000000000..715b4549f
--- /dev/null
+++ b/db/downgrade_0052---0051.sql
@@ -0,0 +1,5 @@
+BEGIN;
+
+DROP TABLE translation;
+
+COMMIT;
diff --git a/db/schema.sql b/db/schema.sql
index d35071c0f..af6570b7a 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -528,3 +528,13 @@ CREATE TABLE contact_defect_types (
ALTER TABLE problem
ADD COLUMN defect_type_id int REFERENCES defect_types(id);
+
+CREATE TABLE translation (
+ id serial not null primary key,
+ tbl text not null,
+ object_id integer not null,
+ col text not null,
+ lang text not null,
+ msgstr text not null,
+ unique(tbl, object_id, col, lang)
+);
diff --git a/db/schema_0052-translation-table.sql b/db/schema_0052-translation-table.sql
new file mode 100644
index 000000000..95df499cc
--- /dev/null
+++ b/db/schema_0052-translation-table.sql
@@ -0,0 +1,13 @@
+BEGIN;
+
+CREATE TABLE translation (
+ id serial not null primary key,
+ tbl text not null,
+ object_id integer not null,
+ col text not null,
+ lang text not null,
+ msgstr text not null,
+ unique(tbl, object_id, col, lang)
+);
+
+COMMIT;
diff --git a/perllib/FixMyStreet/DB/Result/Translation.pm b/perllib/FixMyStreet/DB/Result/Translation.pm
new file mode 100644
index 000000000..fafc7ccf1
--- /dev/null
+++ b/perllib/FixMyStreet/DB/Result/Translation.pm
@@ -0,0 +1,44 @@
+use utf8;
+package FixMyStreet::DB::Result::Translation;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn");
+__PACKAGE__->table("translation");
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "translation_id_seq",
+ },
+ "tbl",
+ { data_type => "text", is_nullable => 0 },
+ "object_id",
+ { data_type => "integer", is_nullable => 0 },
+ "col",
+ { data_type => "text", is_nullable => 0 },
+ "lang",
+ { data_type => "text", is_nullable => 0 },
+ "msgstr",
+ { data_type => "text", is_nullable => 0 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint(
+ "translation_tbl_object_id_col_lang_key",
+ ["tbl", "object_id", "col", "lang"],
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-07-14 23:24:32
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:///VNqg4BOuO29xKhnY8vw
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;