--
-- Database: `patstat`
--
-- BY JULIO RAFFO (EPFL/CEMI)
--
-- --------------------------------------------------------

--
-- new columns for table `tls201_appln`
-- ok

-- filing year column from appln_filing_date
alter TABLE `patstat`.`tls201_appln`
  add column appln_filing_year year(4)
;

UPDATE `patstat`.`tls201_appln`
    SET appln_filing_year=year(appln_filing_date)
;

-- --------------------------------------------------------
--
-- new columns for table `tls211_pat_publn`
--

-- publication year column from publn_date
alter TABLE `patstat`.`tls211_pat_publn`
  add column publn_year year(4)
;

UPDATE `patstat`.`tls211_pat_publn`
    SET publn_year=year(publn_date)
;