aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/downgrade_0052---0051.sql5
-rwxr-xr-xdb/rerun_dbic_loader.pl11
-rw-r--r--db/schema.sql10
-rw-r--r--db/schema_0052-translation-table.sql13
4 files changed, 38 insertions, 1 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/rerun_dbic_loader.pl b/db/rerun_dbic_loader.pl
index 958b28241..cf6e89ab2 100755
--- a/db/rerun_dbic_loader.pl
+++ b/db/rerun_dbic_loader.pl
@@ -3,6 +3,13 @@
use strict;
use warnings;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
# This script inspects the current state of the database and then amends the
# FixMyStreet::DB::Result::* files to suit. After running the changes should be
# inspected before the code is commited.
@@ -20,13 +27,15 @@ my @tables_to_ignore = (
my $exclude = '^(?:' . join( '|', @tables_to_ignore ) . ')$';
make_schema_at(
- 'FixMyStreet::DB',
+ 'FixMyStreet::DB::Schema',
{
debug => 0, # switch on to be chatty
dump_directory => './perllib', # edit files in place
exclude => qr{$exclude}, # ignore some tables
generate_pod => 0, # no need for pod
overwrite_modifications => 1, # don't worry that the md5 is wrong
+ result_namespace => '+FixMyStreet::DB::Result',
+ resultset_namespace => '+FixMyStreet::DB::ResultSet',
# add in some extra components
components => [ 'FilterColumn', 'InflateColumn::DateTime', 'EncodedColumn' ],
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;