diff --git a/DB/README.md b/DB/README.md new file mode 100644 index 0000000..4ae7359 --- /dev/null +++ b/DB/README.md @@ -0,0 +1,11 @@ +# MyJekyllBlog Database Schema + +MyJekyllBlog uses [PostreSQL](https://www.postgresql.org/docs/13/) as its database and [DBIC](https://metacpan.org/pod/DBIx::Class) as its ORM. + +## Update The Database Model + +To update the database model, make your changes in `etc/schema.sql`. Run `./bin/create-classes` to make the changes to the files in `lib/MJB/DB/Result/`. + +Commit these changes. Future installs will use this new model. + +If you have a running instance, you will need to add the create table statements manually, and may need to make `alter table` statements. diff --git a/DB/etc/schema.sql b/DB/etc/schema.sql index 900fec5..1999b4d 100644 --- a/DB/etc/schema.sql +++ b/DB/etc/schema.sql @@ -4,6 +4,8 @@ CREATE TABLE person ( id serial PRIMARY KEY, name text not null, email citext not null unique, + stripe_customer_id text , + is_subscribed boolean not null default false, is_enabled boolean not null default true, is_admin boolean not null default false, created_at timestamptz not null default current_timestamp diff --git a/DB/lib/MJB/DB/Result/Person.pm b/DB/lib/MJB/DB/Result/Person.pm index 8f246a9..e4d711c 100644 --- a/DB/lib/MJB/DB/Result/Person.pm +++ b/DB/lib/MJB/DB/Result/Person.pm @@ -54,6 +54,17 @@ __PACKAGE__->table("person"); data_type: 'citext' is_nullable: 0 +=head2 stripe_customer_id + + data_type: 'text' + is_nullable: 1 + +=head2 is_subscribed + + data_type: 'boolean' + default_value: false + is_nullable: 0 + =head2 is_enabled data_type: 'boolean' @@ -86,6 +97,10 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "email", { data_type => "citext", is_nullable => 0 }, + "stripe_customer_id", + { data_type => "text", is_nullable => 1 }, + "is_subscribed", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "is_enabled", { data_type => "boolean", default_value => \"true", is_nullable => 0 }, "is_admin", @@ -262,8 +277,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B/Ye097ytw5NsHzVYuJgtQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2022-11-30 08:15:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qd7nLf0vOON2dDPyaISk8g use Data::GUID;