mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Prepare new structure for migrations-tooling (#26631)
* Moves existing files around. All essential scripts are in `migrations/bin`, and non-essential scripts like benchmarks are in `migrations/scripts` * Dependabot configuration for migrations-tooling (disabled for now) * Updates test configuration for migrations-tooling * Shorter configuration for intermediate DB for now. We will add the rest table by table. * Adds a couple of benchmark scripts * RSpec setup especially for migrations-tooling and the first tests * Adds sorting/formatting to the `generate_schema` script
This commit is contained in:
5
migrations/db/README.md
Normal file
5
migrations/db/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Intermediate Database
|
||||
|
||||
TODO: Document stuff here.
|
||||
|
||||
## Database Schema
|
6
migrations/db/schema/001-schema_migrations.sql
Normal file
6
migrations/db/schema/001-schema_migrations.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE schema_migrations
|
||||
(
|
||||
path TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME NOT NULL,
|
||||
sql_hash TEXT NOT NULL
|
||||
);
|
5
migrations/db/schema/002-config.sql
Normal file
5
migrations/db/schema/002-config.sql
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE config
|
||||
(
|
||||
name TEXT NOT NULL PRIMARY KEY,
|
||||
value TEXT NOT NULL
|
||||
);
|
8
migrations/db/schema/003-log_entries.sql
Normal file
8
migrations/db/schema/003-log_entries.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE log_entries
|
||||
(
|
||||
created_at DATETIME NOT NULL,
|
||||
type TEXT NOT NULL,
|
||||
message TEXT NOT NULL,
|
||||
exception TEXT,
|
||||
details TEXT
|
||||
);
|
37
migrations/db/schema/100-base-schema.sql
Normal file
37
migrations/db/schema/100-base-schema.sql
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
This file is auto-generated from the Discourse core database schema. Instead of editing it directly,
|
||||
please update the `schema.yml` configuration file and re-run the `generate_schema` script to update it.
|
||||
*/
|
||||
|
||||
CREATE TABLE users
|
||||
(
|
||||
id INTEGER NOT NULL PRIMARY KEY,
|
||||
active BOOLEAN NOT NULL,
|
||||
admin BOOLEAN NOT NULL,
|
||||
approved BOOLEAN NOT NULL,
|
||||
created_at DATETIME NOT NULL,
|
||||
staged BOOLEAN NOT NULL,
|
||||
trust_level INTEGER NOT NULL,
|
||||
username TEXT NOT NULL,
|
||||
views INTEGER NOT NULL,
|
||||
approved_at DATETIME,
|
||||
approved_by_id INTEGER,
|
||||
date_of_birth DATE,
|
||||
first_seen_at DATETIME,
|
||||
flair_group_id INTEGER,
|
||||
group_locked_trust_level INTEGER,
|
||||
ip_address TEXT,
|
||||
last_seen_at DATETIME,
|
||||
locale TEXT,
|
||||
manual_locked_trust_level INTEGER,
|
||||
moderator BOOLEAN,
|
||||
name TEXT,
|
||||
previous_visit_at DATETIME,
|
||||
primary_group_id INTEGER,
|
||||
registration_ip_address TEXT,
|
||||
silenced_till DATETIME,
|
||||
suspended_at DATETIME,
|
||||
suspended_till DATETIME,
|
||||
title TEXT,
|
||||
uploaded_avatar_id INTEGER
|
||||
);
|
Reference in New Issue
Block a user