# Property Management System

## System Requirements
    1. Php 7.3 +
    2. Composer
    3. NPM
    4. php-ext-ctype
    5. php-ext-curl
    6. php-ext-filter
    7. php-ext-hash
    8. php-ext-json
    9. php-ext-mbstring


## Installation
Goto project root directory and run the following commands

```bash
    $ composer up
    $ npm init
    $ npm install sweetalert2
```
### Database Migrations
Installing it to your project
-----------------------------
Just add it to your composer.json (don't forget to specify your bin directory)
Warning, all migrate commands must be executed on your root folder like `bin/migrate migrate:command...`

    {
        "name": "jdoe/testproject",
        "authors": [
            {
                "name": "Jhon DOE",
                "email": "jdoe@gmail.com"
            }
        ],
        "require": {
            "php-database-migration/php-database-migration" :"3.6.*"
        },
        "config": {
            "bin-dir": "bin"
        }
    }


Adding an environment
---------------------
The first thing to do before playing with SQL migrations is to add an environment, let's add the dev one.

```
$ ./bin/migrate migrate:addenv
```

You will be prompted to answer a series of questions about your environment, and then a config file will be saved
in `./.php-database-migration/environments/[env].yml`.

Initialization
--------------
Once the environment is added, you have to initialize it. This verifies that the database connection works, and
creates a new database table for tracking the current database changes:

```
$ ./bin/migrate migrate:init [env]
```

Create a migration
------------------
It is time to create our first migration file.

```
$ ./bin/migrate migrate:create
```

Migrations file are like this

    -- // add table users
    -- Migration SQL that makes the change goes here.
    create table users (id integer, name text);
    -- @UNDO
    -- SQL to undo the change goes here.
    drop table users;

List migrations
------------------
View all available migrations and their status.

```
$ ./bin/migrate migrate:status [env]
+----------------+---------+------------------+--------------------+
| id             | version | applied at       | description        |
+----------------+---------+------------------+--------------------+
| 14679010838251 |         |                  | create table users |
+----------------+---------+------------------+--------------------+
```

Up and down
-----------
You can now up all the pending migrations. If you decide to down a migration, the last one will be downed alone to
prevent mistakes. You will be asked to confirm the downgrade of your database before running the real SQL script.

```
$ ./bin/migrate migrate:up [env]
```

You can mark migrations as applied without executing SQL (e.g. if you switched from another migration system)

```
$ ./bin/migrate migrate:up [env] --changelog-only
```

For development purposes, it is also possible to up a single migration without taking care of the other ones:

```
$ ./bin/migrate migrate:up [env] --only=[migrationid]
```

or migrate to specific migration (it will run all migrations, including the specified migration)

```
$ ./bin/migrate migrate:up [env] --to=[migrationid]
```

Same thing for down:

```
$ ./bin/migrate migrate:down [env] --only=[migrationid]
```

or


```
$ ./bin/migrate migrate:down [env] --to=[migrationid]
```

## License
Propriety Software.
Zentech IT Solution Limited - Ghana
All Rights Reserved @ 2020
https://zentechgh.com