Commit 9337b63
committed
Add script for importing customers
Can be used to seed the database with all the customers we currently
know about:
$ rails runner db/data_migrate/20180807095900_import_customers.rb
The CSV data was generated using the URNs file we are currently sharing
with suppliers. Some of the customers from that file have been excluded:
- Customers with "Active" set to "False" as business cannot be
reported against these
- A handful of "bucket code" URNS that shouldn't be reported against
by suppliers (e.g. Education/991100)
Note that some customers have been given a postcode of 'XXXX'. I'm
assuming this was to get around some limitation in MISO that meant a
postcode needs to be set. Rather than carry this over to the new system,
the script will ignore these postcodes.
Also note that I've updated the rubocop config to exclude the
Rails/Output rule for the data migrations, as there is no reason to
prevent outputting directly to STDOUT from scripts like this that are
expected to be run directly from the terminal.1 parent 058e8a7 commit 9337b63
5 files changed
Lines changed: 50439 additions & 0 deletions
File tree
- db/data_migrate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| |||
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
| 282 | + | |
277 | 283 | | |
278 | 284 | | |
279 | 285 | | |
| |||
0 commit comments