denny/ShinyCMS

View on GitHub
bin/database/data/insert-shared-content-demo-data

Summary

Maintainability
Test Coverage
#!/usr/bin/env perl

# ===================================================================
# File:        bin/database/insert-shared-content-demo-data
# Project:    ShinyCMS
# Purpose:    Insert shared content demo data via DBIC
# 
# Author:    Denny de la Haye <2019@denny.me>
# Copyright (c) 2009-2019 Denny de la Haye
# 
# ShinyCMS is free software; you can redistribute it and/or modify it
# under the terms of either the GPL 2.0 or the Artistic License 2.0
# ===================================================================

use strict;
use warnings;

# Load local helper lib and get connected schema object
use FindBin qw( $Bin );
use lib "$Bin/../../lib";
require 'helpers.pl';  ## no critic

my $schema = get_schema();


# Add some shared content
my $tagline = $schema->resultset( 'SharedContent' )->find_or_create({
    name    => 'site_tagline',
    type    => 'Short Text',
    content => 'Clean and simple content management.',
});
my $powered_by = $schema->resultset( 'SharedContent' )->find_or_create({
    name    => 'powered_by',
    type    => 'Long Text',
    content => 'Powered by <a href="http://shinycms.org/">ShinyCMS</a>',
});