Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to SQLite #16

Open
its-leofisher opened this issue Sep 9, 2024 · 0 comments
Open

Migrate to SQLite #16

its-leofisher opened this issue Sep 9, 2024 · 0 comments
Milestone

Comments

@its-leofisher
Copy link
Owner

its-leofisher commented Sep 9, 2024

Phase1:

DB Schema:

going-light-mongodb

JSON Schema Validation

Device

{
  "bsonType": "object",
  "required": ["device_alias", "ip_addr", "date_created", "date_modified"],
  "properties": {
    "device_alias": {
      "bsonType": "string",
      "maxLength": 200,
      "description": "An alias for the device, must be a string with a max length of 200 characters."
    },
    "ip_addr": {
      "bsonType": "string",
      "description": "The IP address of the device, must be a valid string."
    },
    "device_type": {
      "bsonType": "string",
      "description": "The type of device, can be null if not specified.",
      "nullable": true
    },
    "date_created": {
      "bsonType": "date",
      "description": "The date the device was created, must be a valid date."
    },
    "date_modified": {
      "bsonType": "date",
      "description": "The date the device was last modified, must be a valid date."
    }
  }
}

Behavior Color Map

{
  "bsonType": "object",
  "required": ["behavior_id", "device_id", "color_maps", "date_created"],
  "properties": {
    "behavior_id": {
      "bsonType": "objectId",
      "description": "Unique ID for each behavior, must be an ObjectId"
    },
    "device_id": {
      "bsonType": "objectId",
      "description": "Reference to the device ID, must be an ObjectId"
    },
    "color_maps": {
      "bsonType": "array",
      "description": "Array of color mappings related to behaviors",
      "items": {
        "bsonType": "object",
        "required": ["trigger_keyword", "hex_color", "is_blink"],
        "properties": {
          "trigger_keyword": {
            "bsonType": "string",
            "maxLength": 60,
            "description": "Keyword that triggers the behavior, must be a string with max length 60"
          },
          "hex_color": {
            "bsonType": "string",
            "pattern": "^#?([a-fA-F0-9]{6})$",
            "description": "Hexadecimal color code, must be a valid 6-character hex string"
          },
          "is_blink": {
            "bsonType": "int",
            "minimum": 0,
            "maximum": 1,
            "description": "Flag indicating whether blinking is enabled (1) or disabled (0)"
          }
        }
      }
    },
    "date_created": {
      "bsonType": "date",
      "description": "The date when the behavior color map was created"
    }
  }
}
@its-leofisher its-leofisher added this to the v1.5.0 milestone Sep 9, 2024
@its-leofisher its-leofisher changed the title Migrate to SQLite Migrate to MongoDB Sep 11, 2024
@its-leofisher its-leofisher changed the title Migrate to MongoDB Migrate to MongoDB with Mongoose Sep 11, 2024
@its-leofisher its-leofisher pinned this issue Sep 12, 2024
@its-leofisher its-leofisher changed the title Migrate to MongoDB with Mongoose Migrate to MongoDB w/ pymongo Sep 18, 2024
@its-leofisher its-leofisher changed the title Migrate to MongoDB w/ pymongo Migrate to SQLite Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant