人æã®ç§»åã®æ¿ããã¹ã¿ã¼ãã¢ããæ¥çã«ããªãããæ®ã©ã®å¾æ¥å¡ãè¾ããªããã¨ã話é¡ã¨ãªã£ã¦ãããã½ã¼ã·ã£ã«ã³ã¼ãã£ã³ã°ãµã¼ãã¹Githubã®CEOãTom Preston Werneræ°ããã¤ããã¼ã·ã§ã³ãèµ·ããããã®Githubã®å²å¦ãã«ã¤ãã¦å æ¥ã®OpenCoSFã¨ããã¤ãã³ãã§èªã£ãã ãã¤ããã¼ã·ã§ã³ã¨ã¯æ°ããä½ããã¯ããããã¨ã ããã¨ãä»ã®äººããããã¯ã¬ã¤ã¸ã¼ã ã¨æã£ã¦ãã¦ãããµã³ãã©ã³ã·ã¹ã³ã¯ã¤ããã¼ã·ã§ã³ãèµ·ããã«ã¯æé«ã®å ´æã ãä½ãæ°ãããã¨ããããã¨ã¯ãªã¹ã¯ã ãä½ãèµ·ãããããããªããã¤ããã¼ãã£ãã«ãªãã«ã¯åæ°ãããã ä»ã®äººãããããªããã¯ã¬ã¤ã¸ã¼ã ï¼ãã£ã¦è¨ã£ãã¨ãã¦ãããããããã¨ããå¼·ãææãå¿ è¦ã ãå®éã«ã¹ã¿ã¼ãã¢ããã¯ã¨ã¦ãé«ã確çã§å¤±æãããã§ããµã³ãã©ã³ã·ã¹ã³ã®æåã§ã¯ãã¨ã失æããã¨ãã¦ãã¾ã£ããåé¡ãªããã ã å®éã«ããããã®èµ·æ¥å®¶ã失æãã¦ããããæ°
PostgreSQLã§ã¯ã«ã©ã ã®ãã¼ã¿åã«é åã使ããã¨ãåºæ¥ãããã¡ããSQL99æºæ ãªã®ããªã ä½ã¯ã¨ããããã¼ãã«ãä½æãã SQLã¯ãããªæãã CREATE TABLE favorites ( username varchar(20), -- ã¦ã¼ã¶å category varchar(20), -- ã«ãã´ãªå items varchar(100)[], -- ã¢ã¤ãã åï¼è¤æ°ï¼ PRIMARY KEY(username, category) ); itemsã®é¨åãé åãããã°ã©ãã³ã°è¨èªã®ããã«ååã«æ¬å¼§ãä»ããå½¢ã§æå®ããã æ¬å¼§å ã«è¦ç´ æ°ãæå®ãããã¨ãã§ããããç¾å¨ã®å®è£ ã§ã¯è¦ç´ æ°ã®æå®ã¯ç¡è¦ãããç¡å¶éã¨ãã¦æ±ãããã¨ã®ãã¨ï¼ä½ãSQL99ã®ä»æ§ã§ã¯è¦ç´ æ°ã¯åºå®ã«ããã§ããªãï¼ã ã¾ããé åã®å®£è¨æ¹æ³ã¯SQL99ã«æºæ ããitems varchar(100) ARR
ä»åã®ä»äºã§PostgreSQLã®é å(array)åã使ããã¨ä¾¿å©ãªã®ã§è©¦ãã¦ã¿ã¾ããã Migration Migration 㧠Railsæ¨æºã®å以å¤ã使ãã«ã¯åã®é¨åãæååã§æå®ãã¾ãã class CreateTodos < ActiveRecord::Migration def self.up create_table :todos do |t| t.date :due t.string :task t.column :opts, "integer[]" t.timestamps end end def self.down drop_table :todos end endrake db:migrateããã¨ç¡äºã« é åå ã«ã©ã ãåºæ¥ã¾ããã > \d todos Table "public.todos" Column | Type | Modifiers -------
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}