Skip to content

Commit 5243938

Browse files
author
Kaitlyn Parkhurst
committed
DBIC Generation Support.
1 parent 35eee5f commit 5243938

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

DB/bin/create-classes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
CLASS_NAME="BlogDB::DB"
4+
5+
# Generate a random 8 character name for the docker container that holds the PSQL
6+
# database.
7+
PSQL_NAME=$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z' | fold -w 8 | head -n 1)
8+
9+
# Launch a PSQL Instance
10+
PSQL_DOCKER=`docker run --rm --name $PSQL_NAME -e POSTGRES_PASSWORD=dbic -e POSTGRES_USER=dbic -e POSTGRES_DB=dbic -d \
11+
--mount type=bind,src=$PWD/etc/schema.sql,dst=/docker-entrypoint-initdb.d/schema.sql postgres:11`
12+
13+
docker run --rm --link $PSQL_NAME:psqldb --mount type=bind,src=$PWD,dst=/app symkat/schema_builder /bin/build-schema $CLASS_NAME
14+
15+
docker kill $PSQL_DOCKER
16+
17+
sudo chown -R $USER:$USER lib

DB/dist.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name = BlogDB-DB
2+
author = Kaitlyn Parkhurst <symkat@symkat.com>
3+
license = Perl_5
4+
copyright_holder = Kaitlyn Parkhurst
5+
copyright_year = 2021
6+
abstract = BlogDB's Database
7+
version = 1
8+
9+
[@Basic]
10+
11+
[Prereqs]
12+
DBIx::Class::InflateColumn::Serializer = 0
13+
DBIx::Class::Schema::Config = 0
14+
DBIx::Class::DeploymentHandler = 0
15+
MooseX::AttributeShortcuts = 0
16+
MooseX::Getopt = 0
17+
Data::GUID = 0
18+
DBD::Pg = 0
19+
20+
[AutoPrereqs]

0 commit comments

Comments
 (0)