<commit_before>#
# Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: skylines
# Recipe:: database
#
# Copyright 2013, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This is potentially destructive to the nodes mysql password attributes, since
# we iterate over all the app databags. If this database server provides
# databases for multiple applications, the last app found in the databags
# will win out, so make sure the databags have the same passwords set for
# the root, repl, and debian-sys-maint users.
#

# install the database server
include_recipe "postgresql::server"

# install fuzzystrmatch extension
include_recipe "postgresql::contrib"

# create database user
pg_user "vagrant" do
  privileges :login => true
end

# create database
pg_database "skylines" do
  owner "vagrant"
  encoding "utf8"
  template "template0"
  locale "en_US.UTF8"
end

# add extensions to database
pg_database_extensions "skylines" do
  extensions ["fuzzystrmatch"]
  postgis true
end<commit_msg>cookbooks: Added testing database to provisioning script<commit_after>#
# Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: skylines
# Recipe:: database
#
# Copyright 2013, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This is potentially destructive to the nodes mysql password attributes, since
# we iterate over all the app databags. If this database server provides
# databases for multiple applications, the last app found in the databags
# will win out, so make sure the databags have the same passwords set for
# the root, repl, and debian-sys-maint users.
#

# install the database server
include_recipe "postgresql::server"

# install fuzzystrmatch extension
include_recipe "postgresql::contrib"

# create database user
pg_user "vagrant" do
  privileges :login => true
end

# create databases
pg_database "skylines" do
  owner "vagrant"
  encoding "utf8"
  template "template0"
  locale "en_US.UTF8"
end

pg_database "skylines_test" do
  owner "vagrant"
  encoding "utf8"
  template "template0"
  locale "en_US.UTF8"
end

# add extensions to database
pg_database_extensions "skylines" do
  extensions ["fuzzystrmatch"]
  postgis true
end

pg_database_extensions "skylines_test" do
  extensions ["fuzzystrmatch"]
  postgis true
end
{'fraction_non_alphanumeric': 0.0753551575046325, 'fraction_numerical': 0.0077208153180975915, 'mean_word_length': 4.763345195729538, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '960115', 'n_tokens_mistral': 949, 'n_tokens_neox': 924, 'n_words': 407}