I see Light of the Internet!

This commit is contained in:
Krzysztof 'KrzysiekSiemv' Smaga
2023-04-20 21:45:24 +02:00
commit 41fa19344b
814 changed files with 165027 additions and 0 deletions
+88
View File
@@ -0,0 +1,88 @@
{
"table_name": [
{
"column_name": "NAZWA TABELI", // WYMAGANE!
"datatype": "TYP KOLUMNY", // WYMAGANE!
"length": DŁUGOŚĆ/WIELKOŚĆ WARTOŚCI (0-255), // WYMAGANE DLA DANYCH TYPÓW
"enum_data": [ZBIÓR DANYCH (np. "Jabłko", "Kiwi")], // WYMAGANE DLA ENUM/SET
"primary_key": true/false, // Czy jest to klucz podstawowy
"unique": true/false, // Czy musi być unikalne
"foreign_key": {
"references": "TABELA",
"column": "KOLUMNA Z KTÓREJ POBIERA INDEKS"
},
"auto_increment": true/false, // Czy ma dawać wartości liczbowe rosnące
"not_null": true/false, // Czy kolumna nie może być pusta
"default": {
"value": "DOMYŚLNIE" // Wartość domyślna dla kolumny
"is_string": true/false // WYMAGANE GDY DODAWANE DEFAULT! Czy wartość domyślna jest Stringiem czy czymś innym
}
}
]
// Przykład na dwóch tabelach z relacją 1..n
"users": [
{
"column_name": "id_user",
"datatype": "INT",
"length": 10,
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 24,
"not_null": true
},
{
"column_name": "lastName",
"datatype": "VARCHAR",
"length": 48
},
{
"column_name": "description",
"datatype": "TEXT"
},
{
"column_name": "sex",
"datatype": "ENUM",
"enum_data": ['male', 'female'];
}
],
"posts": [
{
"column_name": "id_post",
"datatype": "INT",
"length": 10,
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_user",
"datatype": "INT",
"length": 10,
"foreign_key": {
"references": "users",
"column": "id_user"
},
"not_null": true
},
{
"column_name": "added_at",
"datatype": "DATETIME",
"not_null": true,
"default": {
"value": "NOW()",
"is_string": false
}
},
{
"column_name": "content",
"datatype": "TEXT",
"not_null": true
}
]
}
+423
View File
@@ -0,0 +1,423 @@
{
"users": [
{
"column_name": "id_user",
"datatype": "INT",
"length": 11,
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "avatar_link",
"datatype": "VARCHAR",
"length": 96
},
{
"column_name": "fname",
"datatype": "VARCHAR",
"length": 28,
"not_null": true
},
{
"column_name": "lname",
"datatype": "VARCHAR",
"length": 40
},
{
"column_name": "login",
"datatype": "VARCHAR",
"length": 32,
"not_null": true
},
{
"column_name": "display_name",
"datatype": "VARCHAR",
"length": 32,
"not_null": true
},
{
"column_name": "password",
"datatype": "TEXT",
"not_null": true
},
{
"column_name": "email",
"datatype": "VARCHAR",
"length": 96,
"not_null": true
},
{
"column_name": "role",
"datatype": "ENUM",
"enum_data": ["administrator", "moderator", "user"],
"not_null": true,
"default": {
"value": "user",
"is_string": true
}
},
{
"column_name": "login_token",
"datatype": "TEXT",
"unique": true,
"not_null": true,
"default": {
"value": "UUID()",
"is_string": false
}
},
{
"column_name": "created_at",
"datatype": "DATETIME",
"length": 0,
"not_null": true,
"default": {
"value": "NOW()",
"is_string": false
}
},
{
"column_name": "modified_at",
"datatype": "DATETIME"
}
],
"posts": [
{
"column_name": "id_post",
"datatype": "INT",
"length": 11,
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_user",
"datatype": "INT",
"length": 11,
"foreign_key": {
"references": "users",
"column": "id_user"
},
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 60,
"not_null": true
},
{
"column_name": "title",
"datatype": "VARCHAR",
"length": 60,
"not_null": true
},
{
"column_name": "content",
"datatype": "LONGTEXT",
"not_null": true
},
{
"column_name": "status",
"datatype": "ENUM",
"enum_data": ["public", "draft"],
"not_null": true,
"default": {
"value": "draft",
"is_string": true
}
},
{
"column_name": "comments",
"datatype": "ENUM",
"enum_data": ["open", "registered", "closed"],
"not_null": true,
"default": {
"value": "open",
"is_string": true
}
},
{
"column_name": "views",
"datatype": "INT",
"length": 11,
"not_null": true,
"default": {
"value": 0,
"is_string": false
}
},
{
"column_name": "added_at",
"datatype": "DATETIME",
"not_null": true,
"default": {
"value": "NOW()",
"is_string": false
}
},
{
"column_name": "updated_at",
"datatype": "DATETIME"
}
],
"comments": [
{
"column_name": "id_comment",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_post",
"datatype": "INT",
"foreign_key": {
"references": "posts",
"column": "id_post"
},
"not_null": true
},
{
"column_name": "id_author",
"datatype": "INT",
"foreign_key": {
"references": "users",
"column": "id_user"
}
},
{
"column_name": "author",
"datatype": "VARCHAR",
"length": 32
},
{
"column_name": "content",
"datatype": "TEXT",
"not_null": true
},
{
"column_name": "author_ip",
"datatype": "VARCHAR",
"length": 15,
"not_null": true
},
{
"column_name": "added_at",
"datatype": "DATETIME",
"not_null": true,
"default": {
"value": "NOW()",
"is_string": false
}
}
],
"tags": [
{
"column_name": "id_tag",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "show_name",
"datatype": "VARCHAR",
"length": 32,
"not_null": true
},
{
"column_name": "slug",
"datatype": "VARCHAR",
"length": 32,
"not_null": true
}
],
"options": [
{
"column_name": "id_option",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 48,
"not_null": true
},
{
"column_name": "value",
"datatype": "TEXT",
"not_null": true
},
{
"column_name": "autoload",
"datatype": "TINYINT",
"length": 1,
"not_null": true,
"default": {
"value": 1,
"is_string": false
}
}
],
"meta_users": [
{
"column_name": "id_umeta",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_user",
"datatype": "INT",
"foreign_key": {
"references": "users",
"column": "id_user"
},
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 48,
"not_null": true
},
{
"column_name": "value",
"datatype": "TEXT",
"not_null": true
}
],
"meta_posts": [
{
"column_name": "id_pmeta",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_post",
"datatype": "INT",
"foreign_key": {
"references": "posts",
"column": "id_post"
},
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 48,
"not_null": true
},
{
"column_name": "value",
"datatype": "TEXT",
"not_null": true
}
],
"meta_comments": [
{
"column_name": "id_cmeta",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_comment",
"datatype": "INT",
"foreign_key": {
"references": "comments",
"column": "id_comment"
},
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 48,
"not_null": true
},
{
"column_name": "value",
"datatype": "TEXT",
"not_null": true
}
],
"meta_tags": [
{
"column_name": "id_tmeta",
"datatype": "INT",
"primary_key": true,
"auto_increment": true,
"not_null": true
},
{
"column_name": "id_tag",
"datatype": "INT",
"foreign_key": {
"references": "tags",
"column": "id_tag"
},
"not_null": true
},
{
"column_name": "name",
"datatype": "VARCHAR",
"length": 48,
"not_null": true
},
{
"column_name": "value",
"datatype": "TEXT",
"not_null": true
}
],
"tag_to_post": [
{
"column_name": "id_tag",
"datatype": "INT",
"foreign_key": {
"references": "tags",
"column": "id_tag"
},
"not_null": true
},
{
"column_name": "id_post",
"datatype": "INT",
"foreign_key": {
"references": "posts",
"column": "id_post"
},
"not_null": true
}
],
"statistics": [
{
"column_name": "count_date",
"datatype": "DATE",
"not_null": true,
"default": {
"value": "NOW()",
"is_string": false
}
},
{
"column_name": "views",
"datatype": "INT",
"not_null": false,
"default": {
"value": 0,
"is_string": false
}
}
]
}