123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- {
- "db_name": "ZeroMe",
- "db_file": "merged-ZeroMe/ZeroMe.db",
- "version": 3,
- "maps": {
- ".+/data/userdb/.+/content.json": {
- "to_json_table": [ "cert_auth_type", "cert_user_id" ],
- "to_table": ["user"]
- },
- ".+/data/userdb/users.*json": {
- "to_table": ["user"]
- },
- ".+/data/users/.+/content.json": {
- "to_json_table": [ "cert_auth_type", "cert_user_id" ],
- "file_name": "data.json"
- },
- ".+/data/users/.+/data.json": {
- "to_table": [
- "post",
- "comment",
- "follow",
- {"node": "post_like", "table": "post_like", "key_col": "post_uri", "val_col": "date_added"}
- ],
- "to_json_table": [ "hub", "user_name", "avatar", "intro" ]
- }
- },
- "tables": {
- "json": {
- "cols": [
- ["json_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
- ["site", "TEXT"],
- ["directory", "TEXT"],
- ["file_name", "TEXT"],
- ["cert_auth_type", "TEXT"],
- ["cert_user_id", "TEXT"],
- ["hub", "TEXT"],
- ["user_name", "TEXT"],
- ["intro", "TEXT"],
- ["avatar", "TEXT"]
- ],
- "indexes": ["CREATE UNIQUE INDEX path ON json(directory, site, file_name)"],
- "schema_changed": 4
- },
- "post": {
- "cols": [
- ["post_id", "INTEGER"],
- ["body", "TEXT"],
- ["meta", "TEXT"],
- ["date_added", "INTEGER"],
- ["json_id", "INTEGER REFERENCES json (json_id)"]
- ],
- "indexes": ["CREATE UNIQUE INDEX post_key ON post(json_id, post_id)", "CREATE INDEX post_id ON post(post_id)", "CREATE INDEX added ON post(date_added)"],
- "schema_changed": 4
- },
- "post_like": {
- "cols": [
- ["post_uri", "TEXT"],
- ["date_added", "INTEGER"],
- ["json_id", "INTEGER REFERENCES json (json_id)"]
- ],
- "indexes": ["CREATE UNIQUE INDEX post_like_key ON post_like(json_id, date_added)", "CREATE INDEX post_uri ON post_like(post_uri)"],
- "schema_changed": 1
- },
- "comment": {
- "cols": [
- ["comment_id", "INTEGER"],
- ["post_uri", "TEXT"],
- ["body", "TEXT"],
- ["date_added", "INTEGER"],
- ["json_id", "INTEGER REFERENCES json (json_id)"]
- ],
- "indexes": ["CREATE UNIQUE INDEX comment_key ON comment(json_id, comment_id)", "CREATE INDEX comment_post_uri ON comment(post_uri)", "CREATE INDEX comment_date_added ON comment(date_added)"],
- "schema_changed": 2
- },
- "follow": {
- "cols": [
- ["follow_id", "INTEGER"],
- ["user_name", "TEXT"],
- ["auth_address", "TEXT"],
- ["hub", "TEXT"],
- ["date_added", "INTEGER"],
- ["json_id", "INTEGER REFERENCES json (json_id)"]
- ],
- "indexes": ["CREATE UNIQUE INDEX follow_key ON follow(json_id, follow_id)", "CREATE INDEX follow_date_added ON follow(date_added)"],
- "schema_changed": 2
- },
- "user": {
- "cols": [
- ["auth_address", "TEXT"],
- ["cert_user_id", "TEXT"],
- ["hub", "TEXT"],
- ["user_name", "TEXT"],
- ["avatar", "TEXT"],
- ["intro", "TEXT"],
- ["date_added", "INTEGER"],
- ["json_id", "INTEGER REFERENCES json (json_id)"]
- ],
- "indexes": ["CREATE INDEX json_id ON user(json_id)", "CREATE INDEX date_added ON user(date_added)"],
- "schema_changed": 3
- }
- },
- "feeds": {
- "Posts": "SELECT 'post' AS type, post.date_added AS date_added, 'In ' || json.user_name || \"'s post\" AS title, post.body AS body, '?Post/' || json.site || '/' || REPLACE(json.directory, 'data/users/', '') || '/' || post_id AS url FROM post LEFT JOIN json USING (json_id)",
- "Comments": "SELECT 'comment' AS type, comment.date_added AS date_added, 'a post' AS title, '@' || user_name || ': ' || comment.body AS body, '?Post/' || json.site || '/' || REPLACE(post_uri, '_', '/') AS url FROM comment LEFT JOIN json USING (json_id)"
- }
- }
|