Repository: mathesar-foundation/mathesar

Issue:
Event Planning Data Set
## Problem
<!-- Please provide a clear and concise description of the problem that this feature request is designed to solve.-->

We don't have an example data set for our live demo that shows how one can use Mathesar to schedule and plan in time.

## Proposed solution
<!-- A clear and concise description of your proposed solution or feature. -->

We'd like to simulate a data set representing a conference (maybe the "Mathesar DevCon" or the like). The conference should take place over a weekend (Friday, Saturday, Sunday). The conference should have speakers who give talks in rooms in some fashion. We'd also like to have 'tracks' describing sequentially scheduled talks (perhaps in different rooms) on some topic.

Example explorations: "First day speakers", "Room A schedule", "everyone talking during time B"

Tables (tentative):
- Speakers
  - id
  - Last Name
  - First Name
  - Bio
- Rooms
  - id
  - Room Number
  - Capacity
- Topics
  - id
  - Name
- Tracks
  - id
  - Name
- Days (just convenience)
  - id
  - Name (First Day, Second Day, Third Day)
  - Date (actual Date)
- Talks
  - id
  - Date (fkey)
  - Time
  - Room (fkey)
  - Title
  - Speaker (fkey)
  - Topic (fkey)
  - Track (fkey)
- Attendees
  - id
  - Last Name
  - First Name
  - Email

If we get this far, we could consider expanding. Also, this table setup should be considered rough, and the implementer is welcome to change/improve it. The goals are explorations like those mentioned above.

## Additional context
<!-- Add any other context or screenshots about the feature request here.-->

See the [Weekly meeting notes](https://wiki.mathesar.org/en/meeting-notes/2022-11/2022-11-17-weekly) where we discussed example data.


Discussion:
For inspiration see the [mathesar-data-playground](https://github.com/centerofci/mathesar-data-playground) repo, as well as the `demo` directory in this repo.

Resolving patch:
diff --git a/demo/install.py b/demo/install.py
--- a/demo/install.py
+++ b/demo/install.py
@@ -13,7 +13,11 @@
 RESOURCES = os.path.join(FILE_DIR, "resources")
 LIBRARY_ONE = os.path.join(RESOURCES, "library_without_checkouts.sql")
 LIBRARY_TWO = os.path.join(RESOURCES, "library_add_checkouts.sql")
+DEVCON_DATASET = os.path.join(RESOURCES, "devcon_dataset.sql")
+MOVIES_SQL_BZ2 = os.path.join(RESOURCES, "movie_collection.sql.bz2")
+
 LIBRARY_MANAGEMENT = 'Library Management'
+MATHESAR_CON = 'Mathesar Con'
 MOVIE_COLLECTION = 'Movie Collection'
 ARXIV = 'Latest Papers from arXiv'
 MOVIES_SQL_BZ2 = os.path.join(RESOURCES, "movie_collection.sql.bz2")
@@ -23,6 +27,7 @@ def load_datasets(engine):
     """Load some SQL files with demo data to DB targeted by `engine`."""
     _load_library_dataset(engine)
     _load_movies_dataset(engine)
+    _load_devcon_dataset(engine)
     _load_arxiv_data_skeleton(engine)
 
 
@@ -56,6 +61,17 @@ def _load_movies_dataset(engine):
         conn.execute(text(f.read()))
 
 
+def _load_devcon_dataset(engine):
+    drop_schema_query = text(f"""DROP SCHEMA IF EXISTS "{MATHESAR_CON}" CASCADE;""")
+    create_schema_query = text(f"""CREATE SCHEMA "{MATHESAR_CON}";""")
+    set_search_path = text(f"""SET search_path="{MATHESAR_CON}";""")
+    with engine.begin() as conn, open(DEVCON_DATASET) as f:
+        conn.execute(drop_schema_query)
+        conn.execute(create_schema_query)
+        conn.execute(set_search_path)
+        conn.execute(text(f.read()))
+
+
 def _load_arxiv_data_skeleton(engine):
     setup_and_register_schema_for_receiving_arxiv_data(engine, schema_name=ARXIV)
 
@@ -63,6 +79,7 @@ def _load_arxiv_data_skeleton(engine):
 def customize_settings(engine):
     """Set preview settings so demo data looks good."""
     _customize_library_preview_settings(engine)
+    _customize_devcon_preview_settings(engine)
 
 
 def _customize_library_preview_settings(engine):
@@ -73,6 +90,12 @@ def _customize_library_preview_settings(engine):
     _set_first_and_last_names_preview(patrons)
 
 
+def _customize_devcon_preview_settings(engine):
+    schema = _get_dj_schema_by_name(engine, MATHESAR_CON)
+    presenters = _get_dj_table_by_name(schema, 'Presenters')
+    _set_first_and_last_names_preview(presenters)
+
+
 def _set_first_and_last_names_preview(table):
     first_name = _get_dj_column_by_name(table, 'First Name')
     last_name = _get_dj_column_by_name(table, 'Last Name')


Test patch: