wiki:NodesDatabase/Schema/Freifunk

 Freifunk Node Database is a simple web application for maintaining a list of nodes (and subnets) within a mesh network such as Freifunk. It's development has just started and therefore most of the features are yet listed as planned.

For a live installation visit  http://db.hannover.freifunk.net

This database is focused on rather "offline" data to be maintained by the node owners. A major design principle applied is KISS. Currently there is no aggregation of live data (except for the live map layer and the topology graph which are both being generated by external scripts).

It is written in Rails. Below you see it's schema definition. Find the  most recent version on github.

ActiveRecord::Schema.define(:version => 20091226184754) do

  create_table "nodes", :force => true do |t|
    t.string   "name"
    t.string   "street"
    t.string   "zip"
    t.string   "city"
    t.decimal  "lat",         :precision => 9, :scale => 6
    t.decimal  "lng",         :precision => 9, :scale => 6
    t.string   "position"
    t.text     "description"
    t.integer  "ip"
    t.integer  "subnet_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "user_id",                                   :default => 1
  end

  add_index "nodes", ["name"], :name => "index_nodes_on_name", :unique => true

  create_table "roles", :force => true do |t|
    t.string "name"
  end

  create_table "roles_users", :id => false, :force => true do |t|
    t.integer "role_id"
    t.integer "user_id"
  end

  add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id"
  add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"

  create_table "subnets", :force => true do |t|
    t.string   "name"
    t.integer  "ip"
    t.integer  "prefix_length"
    t.integer  "max_hosts"
    t.text     "description"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "user_id",       :default => 1
  end

  add_index "subnets", ["name"], :name => "index_subnets_on_name", :unique => true

  create_table "users", :force => true do |t|
    t.string   "login",                     :limit => 40
    t.string   "name",                      :limit => 100, :default => ""
    t.string   "email",                     :limit => 100
    t.string   "crypted_password",          :limit => 40
    t.string   "salt",                      :limit => 40
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "remember_token",            :limit => 40
    t.datetime "remember_token_expires_at"
    t.string   "activation_code",           :limit => 40
    t.datetime "activated_at"
    t.string   "password_reset_code",       :limit => 40
    t.boolean  "enabled",                                  :default => true
  end

  add_index "users", ["login"], :name => "index_users_on_login", :unique => true

end