Giter Club home page Giter Club logo

cb-pa's People

Contributors

kuanb avatar

Watchers

 avatar

cb-pa's Issues

Proposed key components to track by user

We need a structure proposal. Currently it looks like this:


exports.up = function(knex, Promise) {
    return Promise.all([


        knex.schema.createTable("case_managers", function(table) {
            table.increments("cmid").primary();

            table.string("first");
            table.string("last");
            table.boolean("active").defaultTo(true);

            table.timestamp("updated");
            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("clients", function(table) {
            table.increments("uid").primary();

            table.integer("case_manager")
                     .references("cmid")
                     .inTable("case_managers");

            table.string("first");
            table.string("last");
            table.string("otn");
            table.string("so");

            table.timestamp("updated");
            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("events", function(table) {
            table.increments("event_id").primary();

            table.integer("client")
                     .references("uid")
                     .inTable("clients");

            table.dateTime("date_time");
            table.string("case_num");
            table.string("location");
            table.string("notes");
            table.boolean("fta");

            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("messages", function(table) {
            table.integer("client")
                     .references("uid")
                     .inTable("clients");

            table.integer("case_manager")
                     .references("cmid")
                     .inTable("case_managers");

            table.integer("comm_method")
                     .references("comm_id")
                     .inTable("comm_methods");

            table.string("content");

            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("comm_methods", function(table) {
            table.increments("comm_id").primary();

            table.integer("client")
                     .references("uid")
                     .inTable("clients");

            table.string("type");        // e.g. email, cell, landline
            table.string("value");       // e.g. [email protected], 14542348723
            table.string("description"); // e.g. Joe's Obamaphone
            table.boolean("current").defaultTo(true);

            table.dateTime("terminated");
            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("address", function(table) {
            table.integer("client")
                     .references("uid")
                     .inTable("clients");

            table.string("addr1");
            table.string("addr2");
            table.string("city");
            table.string("zip");
            table.string("state");

            table.boolean("current").defaultTo(true);
            table.dateTime("terminated");
            table.timestamp("created").defaultTo(knex.fn.now());
        }),

        knex.schema.createTable("alerts", function(table) {
            table.integer("comm_method")
                     .references("comm_id")
                     .inTable("comm_methods");

            table.integer("event")
                     .references("event_id")
                     .inTable("events");

            table.timestamp("created").defaultTo(knex.fn.now());
        })

    ])
};

exports.down = function(knex, Promise) {
    return Promise.all([

        knex.schema.dropTable("clients"),
        knex.schema.dropTable("events"),
        knex.schema.dropTable("messages"),
        knex.schema.dropTable("comm_methods"),
        knex.schema.dropTable("address"),
        knex.schema.dropTable("case_managers")

    ])
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.