]> git.donarmstrong.com Git - debbugs.git/blob - lib/Debbugs/DB/Result/DbVersion.pm
Add simplistic database upgrade mechanism
[debbugs.git] / lib / Debbugs / DB / Result / DbVersion.pm
1 use utf8;
2 package Debbugs::DB::Result::DbVersion;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Debbugs::DB::Result::DbVersion - Version of the Database Schema
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 COMPONENTS LOADED
19
20 =over 4
21
22 =item * L<DBIx::Class::InflateColumn::DateTime>
23
24 =item * L<DBIx::Class::TimeStamp>
25
26 =back
27
28 =cut
29
30 __PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp");
31
32 =head1 TABLE: C<db_version>
33
34 =cut
35
36 __PACKAGE__->table("db_version");
37
38 =head1 ACCESSORS
39
40 =head2 version
41
42   data_type: 'integer'
43   default_value: 0
44   is_nullable: 0
45
46 Version number of the database
47
48 =head2 date
49
50   data_type: 'timestamp with time zone'
51   default_value: current_timestamp
52   is_nullable: 1
53   original: {default_value => \"now()"}
54
55 Date the database was upgraded to this version
56
57 =head2 metadata
58
59   data_type: 'jsonb'
60   default_value: jsonb_object('{}'::text[])
61   is_nullable: 0
62
63 Details about how the database was upgraded to this version
64
65 =cut
66
67 __PACKAGE__->add_columns(
68   "version",
69   { data_type => "integer", default_value => 0, is_nullable => 0 },
70   "date",
71   {
72     data_type     => "timestamp with time zone",
73     default_value => \"current_timestamp",
74     is_nullable   => 1,
75     original      => { default_value => \"now()" },
76   },
77   "metadata",
78   {
79     data_type     => "jsonb",
80     default_value => \"jsonb_object('{}'::text[])",
81     is_nullable   => 0,
82   },
83 );
84
85 =head1 UNIQUE CONSTRAINTS
86
87 =head2 C<db_version_version_key>
88
89 =over 4
90
91 =item * L</version>
92
93 =back
94
95 =cut
96
97 __PACKAGE__->add_unique_constraint("db_version_version_key", ["version"]);
98
99
100 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-01 13:43:06
101 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xf/jizKdQyo+8jAbc0i3cg
102
103
104 # You can replace this text with custom code or comments, and it will be preserved on regeneration
105 1;