Now with DB instructs, and stripe support.

master
Kaitlyn Parkhurst 3 years ago
parent b4822ad2ae
commit 9f56a6f1b1
  1. 11
      DB/README.md
  2. 2
      DB/etc/schema.sql
  3. 19
      DB/lib/MJB/DB/Result/Person.pm

@ -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.

@ -4,6 +4,8 @@ CREATE TABLE person (
id serial PRIMARY KEY, id serial PRIMARY KEY,
name text not null, name text not null,
email citext not null unique, email citext not null unique,
stripe_customer_id text ,
is_subscribed boolean not null default false,
is_enabled boolean not null default true, is_enabled boolean not null default true,
is_admin boolean not null default false, is_admin boolean not null default false,
created_at timestamptz not null default current_timestamp created_at timestamptz not null default current_timestamp

@ -54,6 +54,17 @@ __PACKAGE__->table("person");
data_type: 'citext' data_type: 'citext'
is_nullable: 0 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 =head2 is_enabled
data_type: 'boolean' data_type: 'boolean'
@ -86,6 +97,10 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0 }, { data_type => "text", is_nullable => 0 },
"email", "email",
{ data_type => "citext", is_nullable => 0 }, { 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", "is_enabled",
{ data_type => "boolean", default_value => \"true", is_nullable => 0 }, { data_type => "boolean", default_value => \"true", is_nullable => 0 },
"is_admin", "is_admin",
@ -262,8 +277,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 # Created by DBIx::Class::Schema::Loader v0.07051 @ 2022-11-30 08:15:37
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B/Ye097ytw5NsHzVYuJgtQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qd7nLf0vOON2dDPyaISk8g
use Data::GUID; use Data::GUID;

Loading…
Cancel
Save