aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Toggle.svelte
blob: 2f92837df25c07c509d1bb536fa9c8082c790269 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<script>
  export let id;
  export let value;
</script>

<label for={id} class="inline-flex relative items-center mr-5 cursor-pointer">
  <input
    type="checkbox"
    bind:checked={value}
    {id}
    name={id}
    class="sr-only peer"
  />
  <div
    class="w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-gray-300 dark:peer-focus:ring-gray-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-green-500"
  />
</label>
ld follow SQL standards: - lower case - underscore_separated_words - options for designated models should be standardized with: { tableName: "table_name", comment: "description of table if not self-evident", timestamps: true, createdAt: 'created_at', updatedAt: 'updated_at', indexes: [ { <as required> } ] }; ## Note regarding field attributes specified in model: - createdAt, updatedAt are renamed to abide by SQL standard. - by default allowNull is false, so this attribute need only be specified when fields are NOT NULL. - comment attribute should added to any field that is not self-evident - may need to add indexes to more fields for rapid access ## Notes regarding changes / updates - Some 1-1 tables are split up simply to separate scope or to control access permission (ie only user_preferences table may be edited by users themselves) ## Sequelize Operational Questions: - Are indexes automatically generated by Sequelize migration for primary keys and/or foreign keys ? - Does Sequelize add non-unique indexes for data mining if specified: eg { fields: ['username'] } - Do timestamp fields require default value spec (eg Sequelize.NOW) ... or how can we define this in model ? ## Ongoing Questions: - payments table needs to be investigated and refactored - is invoices table required or is this just summary information ? - orders table needs to be investigated and refactored - need to add subscriptions table if applicable ( what is this comprised of ?) - user_keys table should be commented to clarify application of each of these values.