<commit_before>import RethinkDB.Query, only: [table_create: 1, table_drop: 1, table: 1, insert: 2]

defmodule Thorium.PageController do
  use Thorium.Web, :controller

  def reset_db(conn, _params) do
    table_drop("simulators") |> DB.run
    table_drop("stations") |> DB.run
    table_drop("cards") |> DB.run

    table_create("simulators") |> DB.run
    table_create("stations") |> DB.run
    table_create("cards") |> DB.run
    
    table("simulators") |> insert(%{
    	id: "voyager",
    	name: "Voyager"
    	}) |> DB.run
    table("stations") |> insert(%{
      id: "voyager-admin",
      name: "Admin",
      simulatorId: "voyager"
      }) |> DB.run
    table("cards") |> insert(%{
      name: "Station Admin",
      component: "AdminStations",
      stationId: "voyager-admin",
      order: 0
      }) |> DB.run
    text conn, "Database Reset"
  end


  def index(conn, _params) do
    render conn, "index.html"
  end

end
<commit_msg>Add table for systems.<commit_after>import RethinkDB.Query, only: [table_create: 1, table_drop: 1, table: 1, insert: 2]

defmodule Thorium.PageController do
  use Thorium.Web, :controller

  def reset_db(conn, _params) do
    table_drop("simulators") |> DB.run
    table_drop("stations") |> DB.run
    table_drop("cards") |> DB.run
    table_drop("systems") |> DB.run
    
    table_create("simulators") |> DB.run
    table_create("stations") |> DB.run
    table_create("cards") |> DB.run
    table_create("systems") |> DB.run

    table("simulators") |> insert(%{
    	id: "voyager",
    	name: "Voyager"
    	}) |> DB.run
    table("stations") |> insert(%{
      id: "voyager-admin",
      name: "Admin",
      simulatorId: "voyager"
      }) |> DB.run
    table("cards") |> insert(%{
      name: "Station Admin",
      component: "AdminStations",
      stationId: "voyager-admin",
      order: 0
      }) |> DB.run
    text conn, "Database Reset"
  end


  def index(conn, _params) do
    render conn, "index.html"
  end

end

{'fraction_non_alphanumeric': 0.15848101265822784, 'fraction_numerical': 0.005063291139240506, 'mean_word_length': 2.9599198396793587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '346605', 'n_tokens_mistral': 734, 'n_tokens_neox': 707, 'n_words': 157}