<?php
namespace Claromentis\Setup\Db\Migrations;

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_3c4298ad" . "118f03549" . "387eda8af" . "859750" => base64_decode("QXBwbGljYXRpb24gYWxyZWFkeSBpbnN0" . "YWxsZWQ="), "_afa8b786a0282957bc5e6c82eb5e" . "eaba" => base64_decode("U2NoZW1hIGZpbGUgZG9lc24n" . "dCBleGlzdCBvciBub3QgcmVh" . "ZGFibGUsIHNraXBwaW5nIHNj" . "aGVtYSBjcmVhdGlvbg=="), "_9808001" . "2c02491a" . "0c0cf9af" . "5c977f3c" . "7" => base64_decode("U2NoZW1hI" . "GZpbGU6IA" . "=="), "_4e804c3c659ffa" . "927094580817423" . "76b" => base64_decode("Q3JlYXRpbmcgc" . "2NoZW1h"), "_edc5e56d0d74937af4aa" . "39a12b4e62f4" => base64_decode("MDAuMD" . "A="), "_98587fc188f350370f03d54" . "707c587e1" => base64_decode("aXNf" . "cmVh" . "ZGFi" . "bGU="), "_bc2b2cbee209b1cad0873479a8fd9" . "21a" => base64_decode("L3NjaGVtYS9zY" . "2hlbWEucGhw"), "_c1bf7b7ebd1ab8431a8561d762db1" . "895" => base64_decode("QXBwbGljYXRpb24gaXMg" . "bm90IGluc3RhbGxlZC4g" . "Q2Fubm90IHVwZGF0ZQ=="), "_e608e5b5c4c34a67ba97e" . "f84c1e16199" => base64_decode("Jw=" . "="), "_0a441bddac7bebad7a9858a0dfadcd9" . "0" => base64_decode("MDEuMDE" . "="), "_09fd03941a048e1f28e8231" . "89007cddf" => base64_decode("U2NoZW1hIHN1Y2Nlc3NmdW" . "xseSBjcmVhdGVkLiBDdXJy" . "ZW50IHZlcnNpb24gaXMgJw" . "=="));
use Claromentis\Setup\Exception\AlreadyInstalledException;
use Claromentis\Setup\Exception\NotInstalledException;




class Schema extends MigrationsBase
{
    
    
    
    
    
    
    
    
    public function Install()
    {
        if ($this->IsSchemaCreated()) {
            throw new AlreadyInstalledException($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_3c4298a" . "d118f035" . "49387eda" . "8af85975" . "0"]);
        }
        $this->CreateSchema();
    }
    
    
    
    
    
    
    
    
    public function Update()
    {
        if (!$this->IsSchemaCreated()) {
            throw new NotInstalledException($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_c1bf7b7ebd1ab8431" . "a8561d762db1895"]);
        }
    }
    
    
    
    
    public function Up()
    {
        if (!$this->IsSchemaCreated()) {
            $this->CreateSchema();
        }
    }
    
    
    
    
    
    
    protected function IsSchemaCreated()
    {
        return $this->persistence->GetVersion() !== null;
    }
    
    
    
    
    protected function CreateSchema()
    {
        $_3d94334dda6f8e448f15c2285d522e72 = $this->init_path . $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_bc2b2cbee209" . "b1cad0873479a" . "8fd921a"];
        if ($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_98587fc188f" . "350370f03d54" . "707c587e1"]($_3d94334dda6f8e448f15c2285d522e72)) {
            $this->logger->info($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_98080012c02" . "491a0c0cf9af" . "5c977f3c7"] . $_3d94334dda6f8e448f15c2285d522e72);
            $this->logger->notice($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_4e804c3c659ffa927094580817" . "42376b"]);
            extract($this->environment, EXTR_REFS | EXTR_OVERWRITE);
            include $_3d94334dda6f8e448f15c2285d522e72;
            if (!$this->persistence->GetVersion()) {
                $this->persistence->SetVersion($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_0a441bddac7bebad7a" . "9858a0dfadcd90"]);
            }
            $this->logger->notice($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_09fd03941a" . "048e1f28e82" . "3189007cddf"] . $this->persistence->GetVersion() . $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_e608e5b" . "5c4c34a6" . "7ba97ef8" . "4c1e1619" . "9"]);
        } else {
            $this->logger->warning($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_afa8b786a0282957bc5e6c82eb" . "5eeaba"]);
            $this->persistence->SetVersion($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_edc5e56d0d74937af4a" . "a39a12b4e62f4"]);
        }
    }
}